Skip to content

Commit

Permalink
test: accommodate EPIPE on Windows
Browse files Browse the repository at this point in the history
test-cluster-shared-leak.js was flaky because a worker can emit EPIPE.
This error event is expected.

Fixes: nodejs#3956
  • Loading branch information
Trott committed Dec 7, 2015
1 parent d2c8ba5 commit 6897612
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-cluster-shared-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ if (cluster.isMaster) {
worker1 = cluster.fork();
worker1.on('message', common.mustCall(function() {
worker2 = cluster.fork();
worker2.on('error', function(e) {
// EPIPE is OK on Windows
if ((! common.isWindows) || (e.code !== 'EPIPE'))
throw e;
});
conn = net.connect(common.PORT, common.mustCall(function() {
worker1.send('die');
worker2.send('die');
Expand Down

0 comments on commit 6897612

Please sign in to comment.