We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 293cfa8 commit e81fc3dCopy full SHA for e81fc3d
packages/pg-pool/test/idle-timeout.js
@@ -25,6 +25,7 @@ describe('idle timeout', () => {
25
it(
26
'times out and removes clients when others are also removed',
27
co.wrap(function* () {
28
+ let currentClient = 1
29
const pool = new Pool({ idleTimeoutMillis: 10 })
30
const clientA = yield pool.connect()
31
const clientB = yield pool.connect()
@@ -35,7 +36,12 @@ describe('idle timeout', () => {
35
36
pool.on('remove', () => {
37
expect(pool.idleCount).to.equal(0)
38
expect(pool.totalCount).to.equal(0)
- resolve()
39
+
40
+ if (currentClient >= 2) {
41
+ resolve()
42
+ } else {
43
+ currentClient++
44
+ }
45
})
46
47
0 commit comments