Skip to content

Commit 5d7265f

Browse files
committedMar 3, 2016
test: prevent flakey test on pi2
Looping rapidly and making new connections causes problems on pi2. Instead create a new connection when an old connection has already been made. Running a stress test of 600 times and they all passed. Fixes: #5302 PR-URL: #5537 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Alexis Campailla <[email protected]>
1 parent 7d3a7ea commit 5d7265f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed
 

‎test/parallel/parallel.status

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ prefix parallel
1010
test-tick-processor : PASS,FLAKY
1111

1212
[$system==linux]
13-
test-process-getactivehandles : PASS,FLAKY
1413
test-tick-processor : PASS,FLAKY
1514

1615
[$system==macos]

‎test/parallel/test-process-getactivehandles.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ var clients_counter = 0;
1010

1111
const server = net.createServer(function listener(c) {
1212
connections.push(c);
13-
}).listen(common.PORT, function makeConnections() {
14-
for (var i = 0; i < NUM; i++) {
15-
net.connect(common.PORT, function connected() {
16-
clientConnected(this);
17-
});
18-
}
19-
});
13+
}).listen(common.PORT, makeConnection);
14+
15+
16+
function makeConnection() {
17+
if (clients_counter >= NUM) return;
18+
net.connect(common.PORT, function connected() {
19+
clientConnected(this);
20+
makeConnection();
21+
});
22+
}
2023

2124

2225
function clientConnected(client) {

0 commit comments

Comments
 (0)
Please sign in to comment.