Skip to content

Commit

Permalink
test: allow ENFILE in test-worker-init-failure
Browse files Browse the repository at this point in the history
Refs: nodejs#34727 (comment)

PR-URL: nodejs#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]>
  • Loading branch information
Trott committed Aug 16, 2020
1 parent 375b859 commit 97d9b9c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-worker-init-failure.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +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 `EMFILE` or `ERR_WORKER_INIT_FAILED`.
// environment, it will be one of `ENFILE`, `EMFILE`, or
// `ERR_WORKER_INIT_FAILED`.
const allowableCodes = ['ERR_WORKER_INIT_FAILED', 'EMFILE', 'ENFILE'];

// `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(e.code === 'ERR_WORKER_INIT_FAILED' || e.code === 'EMFILE');
assert.ok(allowableCodes.includes(e.code), `${e.code} not expected`);
});
}

Expand Down

0 comments on commit 97d9b9c

Please sign in to comment.