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 ec24d37

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: fix flaky test-cluster-shared-leak
Wait for worker2 to come online before doing anything that might result in an EPIPE. Fixes flakiness of test on Windows. Fixes: #3956 PR-URL: #4510 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell<jasnell@gmail.com>
1 parent b8213ba commit ec24d37
Copy full SHA for ec24d37

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+10
-9
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
@@ -7,7 +7,6 @@ prefix parallel
77
[true] # This section applies to all platforms
88

99
[$system==win32]
10-
test-cluster-shared-leak : PASS,FLAKY
1110
test-debug-no-context : PASS,FLAKY
1211
test-tls-ticket-cluster : PASS,FLAKY
1312

Collapse file

‎test/parallel/test-cluster-shared-leak.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-cluster-shared-leak.js
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ if (cluster.isMaster) {
1515
worker1 = cluster.fork();
1616
worker1.on('message', common.mustCall(function() {
1717
worker2 = cluster.fork();
18-
conn = net.connect(common.PORT, common.mustCall(function() {
19-
worker1.send('die');
20-
worker2.send('die');
21-
}));
22-
conn.on('error', function(e) {
23-
// ECONNRESET is OK
24-
if (e.code !== 'ECONNRESET')
25-
throw e;
18+
worker2.on('online', function() {
19+
conn = net.connect(common.PORT, common.mustCall(function() {
20+
worker1.send('die');
21+
worker2.send('die');
22+
}));
23+
conn.on('error', function(e) {
24+
// ECONNRESET is OK
25+
if (e.code !== 'ECONNRESET')
26+
throw e;
27+
});
2628
});
2729
}));
2830

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.