Skip to content

Commit aa73882

Browse files
committed
tests: fix flaky cluster rr test
1 parent d19fba4 commit aa73882

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/unit/pool-cluster/test-connection-rr.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ server.listen(common.fakeServerPort, function(err) {
2929

3030
var pool = cluster.of('SLAVE*', 'RR');
3131

32-
for (var i = 0; i < count; i++) {
32+
function getConnection(i) {
3333
pool.getConnection(function (err, conn) {
3434
assert.ifError(err);
35-
order.push(conn._clusterId);
35+
order[i] = conn._clusterId;
3636
conn.release();
3737
done();
3838
});
3939
}
40+
41+
for (var i = 0; i < count; i++) {
42+
getConnection(i);
43+
}
4044
});

0 commit comments

Comments
 (0)