Skip to content

Commit e6680ef

Browse files
davimacedodplewis
authored andcommitted
Fix flaky test4 (#7212)
* Increase timeout for redis tests * Remove for * Increase little bit more one of the tests since it requires two calls to be done in time-fahsion way * increase default ttl a bit more
1 parent d753152 commit e6680ef

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

spec/RedisCacheAdapter.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ describe_only(() => {
3333
});
3434

3535
it('should expire after ttl', done => {
36-
const cache = new RedisCacheAdapter(null, 50);
36+
const cache = new RedisCacheAdapter(null, 100);
3737

3838
cache
3939
.put(KEY, VALUE)
4040
.then(() => cache.get(KEY))
4141
.then(value => expect(value).toEqual(VALUE))
42-
.then(wait.bind(null, 52))
42+
.then(wait.bind(null, 102))
4343
.then(() => cache.get(KEY))
4444
.then(value => expect(value).toEqual(null))
4545
.then(done);
4646
});
4747

4848
it('should not store value for ttl=0', done => {
49-
const cache = new RedisCacheAdapter(null, 5);
49+
const cache = new RedisCacheAdapter(null, 100);
5050

5151
cache
5252
.put(KEY, VALUE, 0)
@@ -56,20 +56,20 @@ describe_only(() => {
5656
});
5757

5858
it('should not expire when ttl=Infinity', done => {
59-
const cache = new RedisCacheAdapter(null, 1);
59+
const cache = new RedisCacheAdapter(null, 100);
6060

6161
cache
6262
.put(KEY, VALUE, Infinity)
6363
.then(() => cache.get(KEY))
6464
.then(value => expect(value).toEqual(VALUE))
65-
.then(wait.bind(null, 5))
65+
.then(wait.bind(null, 102))
6666
.then(() => cache.get(KEY))
6767
.then(value => expect(value).toEqual(VALUE))
6868
.then(done);
6969
});
7070

7171
it('should fallback to default ttl', done => {
72-
const cache = new RedisCacheAdapter(null, 1);
72+
const cache = new RedisCacheAdapter(null, 100);
7373
let promise = Promise.resolve();
7474

7575
[-100, null, undefined, 'not number', true].forEach(ttl => {
@@ -78,7 +78,7 @@ describe_only(() => {
7878
.put(KEY, VALUE, ttl)
7979
.then(() => cache.get(KEY))
8080
.then(value => expect(value).toEqual(VALUE))
81-
.then(wait.bind(null, 5))
81+
.then(wait.bind(null, 102))
8282
.then(() => cache.get(KEY))
8383
.then(value => expect(value).toEqual(null))
8484
);
@@ -88,7 +88,7 @@ describe_only(() => {
8888
});
8989

9090
it('should find un-expired records', done => {
91-
const cache = new RedisCacheAdapter(null, 5);
91+
const cache = new RedisCacheAdapter(null, 100);
9292

9393
cache
9494
.put(KEY, VALUE)
@@ -101,7 +101,7 @@ describe_only(() => {
101101
});
102102

103103
it('handleShutdown, close connection', async () => {
104-
const cache = new RedisCacheAdapter(null, 5);
104+
const cache = new RedisCacheAdapter(null, 100);
105105

106106
await cache.handleShutdown();
107107
setTimeout(() => {

0 commit comments

Comments
 (0)