From 4e346e85cfbb7a10a47f7508f59fe328eed4ca49 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 19 Nov 2021 08:33:31 +0100 Subject: [PATCH] test: deflake cluster-concurrent-disconnect Occasionally the error code is `'ENOTCONN'` on macOS. Add it as an allowed/expected code. Fixes: https://github.com/nodejs/node/issues/38405 --- test/parallel/test-cluster-concurrent-disconnect.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-cluster-concurrent-disconnect.js b/test/parallel/test-cluster-concurrent-disconnect.js index 4920276745c180..d97db39a5bb38a 100644 --- a/test/parallel/test-cluster-concurrent-disconnect.js +++ b/test/parallel/test-cluster-concurrent-disconnect.js @@ -26,7 +26,11 @@ if (cluster.isPrimary) { // to send messages when the worker is disconnecting. worker.on('error', (err) => { assert.strictEqual(err.syscall, 'write'); - assert.strictEqual(err.code, 'EPIPE'); + if (common.isOSX) { + assert(['EPIPE', 'ENOTCONN'].includes(err.code), err); + } else { + assert.strictEqual(err.code, 'EPIPE'); + } }); worker.once('disconnect', common.mustCall(() => {