Skip to content

Commit 2aa207e

Browse files
committed
Update test semantics
1 parent ad73407 commit 2aa207e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

test/index.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,11 @@ describe('pool', function () {
7070
it('properly pools clients', co.wrap(function * () {
7171
var pool = new Pool({ poolSize: 9 })
7272
var count = 0
73-
while (count < 30) {
74-
count++
75-
pool.connect().then(function (client) {
76-
client.queryAsync('select $1::text as name', ['hi']).then(function (res) {
77-
client.release()
78-
})
79-
})
80-
}
81-
yield Promise.delay(100)
73+
yield _.times(30).map(function * () {
74+
var client = yield pool.connect()
75+
var result = yield client.queryAsync('select $1::text as name', ['hi'])
76+
client.release()
77+
})
8278
expect(pool.pool.getPoolSize()).to.be(9)
8379
return yield pool.end()
8480
}))

0 commit comments

Comments
 (0)