mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: allow ENOENT in test-worker-init-failure
PR-URL: https://github.com/nodejs/node/pull/34769 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
This commit is contained in:
@@ -30,14 +30,14 @@ if (process.argv[2] === 'child') {
|
||||
});
|
||||
|
||||
// We want to test that if there is an error in a constrained running
|
||||
// environment, it will be one of `ENFILE`, `EMFILE`, or
|
||||
// environment, it will be one of `ENFILE`, `EMFILE`, 'ENOENT', or
|
||||
// `ERR_WORKER_INIT_FAILED`.
|
||||
const allowableCodes = ['ERR_WORKER_INIT_FAILED', 'EMFILE', 'ENFILE'];
|
||||
const expected = ['ERR_WORKER_INIT_FAILED', 'EMFILE', 'ENFILE', 'ENOENT'];
|
||||
|
||||
// `common.mustCall*` cannot be used here as in some environments
|
||||
// (i.e. single cpu) `ulimit` may not lead to such an error.
|
||||
worker.on('error', (e) => {
|
||||
assert.ok(allowableCodes.includes(e.code), `${e.code} not expected`);
|
||||
assert.ok(expected.includes(e.code), `${e.code} not expected`);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user