Skip to content

Commit f434394

Browse files
committed
test: fix EPIPE on Windows
Refactor test-cluster-shared-leak.js to remove flakiness on Windows. Fixes: nodejs#3956 PR-URL: nodejs#4173
1 parent 57a51a0 commit f434394

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/parallel/parallel.status

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ prefix parallel
99
[$system==win32]
1010
test-child-process-fork-regr-gh-2847 : PASS,FLAKY
1111
test-cluster-net-send : PASS,FLAKY
12-
test-cluster-shared-leak : PASS,FLAKY
1312
test-tls-ticket-cluster : PASS,FLAKY
1413

1514
[$system==linux]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ if (cluster.isMaster) {
1515
worker1 = cluster.fork();
1616
worker1.on('message', common.mustCall(function() {
1717
worker2 = cluster.fork();
18+
// make sure worker2 is listening before doing anything else
1819
conn = net.connect(common.PORT, common.mustCall(function() {
1920
worker1.send('die');
20-
worker2.send('die');
2121
}));
2222
conn.on('error', function(e) {
2323
// ECONNRESET is OK
2424
if (e.code !== 'ECONNRESET')
2525
throw e;
2626
});
27+
worker2.send('die');
2728
}));
2829

2930
cluster.on('exit', function(worker, exitCode, signalCode) {

0 commit comments

Comments
 (0)