Skip to content

Commit aaf4dbc

Browse files
claudiorodriguezMyles Borins
authored and
Myles Borins
committed
test: fix flaky test-cluster-shared-leak
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]>
1 parent c2514b5 commit aaf4dbc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ if (cluster.isMaster) {
4040
}
4141

4242
const server = net.createServer(function(c) {
43+
c.on('error', function(e) {
44+
// ECONNRESET is OK, so we don't exit with code !== 0
45+
if (e.code !== 'ECONNRESET')
46+
throw e;
47+
});
4348
c.end('bye');
4449
});
4550

0 commit comments

Comments
 (0)