Skip to content

Commit

Permalink
test: fix flaky test-cluster-shared-leak
Browse files Browse the repository at this point in the history
Test was flaky on centos7-64 due to an uncaught ECONNRESET
on the worker code. This catches the error so the process
will exit with code 0.

Fixes: #5604
PR-URL: #5802
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
claudiorodriguez authored and Fishrock123 committed Mar 22, 2016
1 parent 3fef69b commit f0d885a
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 @@ -40,6 +40,11 @@ if (cluster.isMaster) {
}

const server = net.createServer(function(c) {
c.on('error', function(e) {
// ECONNRESET is OK, so we don't exit with code !== 0
if (e.code !== 'ECONNRESET')
throw e;
});
c.end('bye');
});

Expand Down

0 comments on commit f0d885a

Please sign in to comment.