Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d7265f

Browse filesBrowse files
committed
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 <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
1 parent 7d3a7ea commit 5d7265f
Copy full SHA for 5d7265f

File tree

Expand file treeCollapse file tree

2 files changed

+10
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-8
lines changed
Open diff view settings
Collapse file

‎test/parallel/parallel.status‎

Copy file name to clipboardExpand all lines: test/parallel/parallel.status
-1Lines changed: 0 additions & 1 deletion
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]
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-process-getactivehandles.js
+10-7Lines changed: 10 additions & 7 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.