Skip to content

Commit

Permalink
test: fix EPIPE on Windows
Browse files Browse the repository at this point in the history
Refactor test-cluster-shared-leak.js to remove flakiness on Windows.

Fixes: nodejs#3956
PR-URL: nodejs#4173
  • Loading branch information
Trott committed Dec 27, 2015
1 parent 57a51a0 commit f434394
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ prefix parallel
[$system==win32]
test-child-process-fork-regr-gh-2847 : PASS,FLAKY
test-cluster-net-send : PASS,FLAKY
test-cluster-shared-leak : PASS,FLAKY
test-tls-ticket-cluster : PASS,FLAKY

[$system==linux]
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-cluster-shared-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ if (cluster.isMaster) {
worker1 = cluster.fork();
worker1.on('message', common.mustCall(function() {
worker2 = cluster.fork();
// make sure worker2 is listening before doing anything else
conn = net.connect(common.PORT, common.mustCall(function() {
worker1.send('die');
worker2.send('die');
}));
conn.on('error', function(e) {
// ECONNRESET is OK
if (e.code !== 'ECONNRESET')
throw e;
});
worker2.send('die');
}));

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

0 comments on commit f434394

Please sign in to comment.