From 386c7c1c35c2782558e34fd0fc3757f33b620e30 Mon Sep 17 00:00:00 2001 From: Claudio Rodriguez Date: Sat, 19 Mar 2016 15:03:14 -0300 Subject: [PATCH] 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 --- test/parallel/test-cluster-shared-leak.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-cluster-shared-leak.js b/test/parallel/test-cluster-shared-leak.js index 9235c1ea60a672..ad13a869b2b8e0 100644 --- a/test/parallel/test-cluster-shared-leak.js +++ b/test/parallel/test-cluster-shared-leak.js @@ -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'); });