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

PR-URL: https://github.com/nodejs/node/pull/40877
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
Luigi Pinca
2021-11-21 21:44:39 +01:00
committed by GitHub
parent c6352f5653
commit 977877b52a

View File

@@ -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(() => {