Skip to content

Commit 238d01f

Browse files
Trottaddaleax
authored andcommitted
test: allow ENFILE in test-worker-init-failure
Refs: #34727 (comment) PR-URL: #34769 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ricky Zhou <[email protected]>
1 parent 5119586 commit 238d01f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-worker-init-failure.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ if (process.argv[2] === 'child') {
3030
});
3131

3232
// We want to test that if there is an error in a constrained running
33-
// environment, it will be one of `EMFILE` or `ERR_WORKER_INIT_FAILED`.
33+
// environment, it will be one of `ENFILE`, `EMFILE`, or
34+
// `ERR_WORKER_INIT_FAILED`.
35+
const allowableCodes = ['ERR_WORKER_INIT_FAILED', 'EMFILE', 'ENFILE'];
36+
3437
// `common.mustCall*` cannot be used here as in some environments
3538
// (i.e. single cpu) `ulimit` may not lead to such an error.
36-
3739
worker.on('error', (e) => {
38-
assert.ok(e.code === 'ERR_WORKER_INIT_FAILED' || e.code === 'EMFILE');
40+
assert.ok(allowableCodes.includes(e.code), `${e.code} not expected`);
3941
});
4042
}
4143

0 commit comments

Comments
 (0)