Skip to content

Commit 47afe5c

Browse files
authored
Attempt to fix timing test flake on older versions of node in CI (brianc#2902)
1 parent bb8745b commit 47afe5c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/pg-pool/test/lifetime-timeout.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('lifetime timeout', () => {
2121
})
2222
it('connection lifetime should expire and remove the client after the client is done working', (done) => {
2323
const pool = new Pool({ maxLifetimeSeconds: 1 })
24-
pool.query('SELECT pg_sleep(1.01)')
24+
pool.query('SELECT pg_sleep(1.4)')
2525
pool.on('remove', () => {
2626
console.log('expired while busy - on-remove event')
2727
expect(pool.expiredCount).to.equal(0)
@@ -33,10 +33,11 @@ describe('lifetime timeout', () => {
3333
'can remove expired clients and recreate them',
3434
co.wrap(function* () {
3535
const pool = new Pool({ maxLifetimeSeconds: 1 })
36-
let query = pool.query('SELECT pg_sleep(1)')
36+
let query = pool.query('SELECT pg_sleep(1.4)')
3737
expect(pool.expiredCount).to.equal(0)
3838
expect(pool.totalCount).to.equal(1)
3939
yield query
40+
yield new Promise((resolve) => setTimeout(resolve, 100))
4041
expect(pool.expiredCount).to.equal(0)
4142
expect(pool.totalCount).to.equal(0)
4243
yield pool.query('SELECT NOW()')

0 commit comments

Comments
 (0)