Skip to content

Commit 4288c6a

Browse files
lpincatargos
authored andcommitted
test: deflake cluster-concurrent-disconnect
Occasionally the error code is `'ENOTCONN'` on macOS. Add it as an allowed/expected code. Fixes: #38405 PR-URL: #40877 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 009ab4d commit 4288c6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/parallel/test-cluster-concurrent-disconnect.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ if (cluster.isPrimary) {
2626
// to send messages when the worker is disconnecting.
2727
worker.on('error', (err) => {
2828
assert.strictEqual(err.syscall, 'write');
29-
assert.strictEqual(err.code, 'EPIPE');
29+
if (common.isOSX) {
30+
assert(['EPIPE', 'ENOTCONN'].includes(err.code), err);
31+
} else {
32+
assert.strictEqual(err.code, 'EPIPE');
33+
}
3034
});
3135

3236
worker.once('disconnect', common.mustCall(() => {

0 commit comments

Comments
 (0)