Skip to content

Commit

Permalink
test: deflake cluster-concurrent-disconnect
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
lpinca authored and danielleadams committed Feb 1, 2022
1 parent 9e2e443 commit ab398b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/parallel/test-cluster-concurrent-disconnect.js
Expand Up @@ -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(() => {
Expand Down

0 comments on commit ab398b6

Please sign in to comment.