aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorClaudio Rodriguez <cjrodr@yahoo.com>2016-03-19 15:03:14 -0300
committerJames M Snell <jasnell@gmail.com>2016-03-21 08:53:44 -0700
commit74a703df845c647d054c228390019e1a58a6ab23 (patch)
treeee800e4acd517cd9e0f9bbe896c5be6bbd271d15 /test
parentb9299884dc1a15c2b08429d3adba1d9bba5b3af4 (diff)
downloadandroid-node-v8-74a703df845c647d054c228390019e1a58a6ab23.tar.gz
android-node-v8-74a703df845c647d054c228390019e1a58a6ab23.tar.bz2
android-node-v8-74a703df845c647d054c228390019e1a58a6ab23.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-cluster-shared-leak.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-cluster-shared-leak.js b/test/parallel/test-cluster-shared-leak.js
index 9235c1ea60..ad13a869b2 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');
});