Skip to content

Commit

Permalink
fixup: revert to previous workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Dec 8, 2015
1 parent 4624147 commit 253fd62
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/parallel/test-cluster-shared-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ if (cluster.isMaster) {
worker1 = cluster.fork();
worker1.on('message', common.mustCall(function() {
worker2 = cluster.fork();
// make sure worker2 is listening before doing anything else
cluster.once('listening', function() {
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')
return;
throw e;
});
worker2.on('error', function(e) {
console.error('worker2 error');
// EPIPE is OK on Windows
if (common.isWindows && e.code === 'EPIPE')
return;
throw e;
});
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')
return;
throw e;
});
}));

Expand Down

0 comments on commit 253fd62

Please sign in to comment.