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: https://github.com/nodejs/node/issues/5604 PR-URL: https://github.com/nodejs/node/pull/5802 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
b9299884dc
commit
74a703df84
@ -40,6 +40,11 @@ if (cluster.isMaster) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const server = net.createServer(function(c) {
|
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');
|
c.end('bye');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user