From 4288c6a26ec56b0447b22e700b45bba4e24bfff8 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 21 Nov 2021 21:44:39 +0100 Subject: [PATCH] test: deflake cluster-concurrent-disconnect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Occasionally the error code is `'ENOTCONN'` on macOS. Add it as an allowed/expected code. Fixes: https://github.com/nodejs/node/issues/38405 PR-URL: https://github.com/nodejs/node/pull/40877 Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott Reviewed-By: Tobias Nießen Reviewed-By: Yongsheng Zhang --- 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(() => {