Skip to content

Commit

Permalink
[jest-worker] Don't crash when running node with flags disallowed in …
Browse files Browse the repository at this point in the history
…workers (#12128)
  • Loading branch information
nicolo-ribaudo authored Dec 10, 2021
1 parent f8887d5 commit 5ccb0a0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- `[babel-jest]` Add `process.version` chunk to the cache key ([#12122](https://github.com/facebook/jest/pull/12122))
- `[jest-worker]` Stop explicitly passing `execArgv` ([#12128](https://github.com/facebook/jest/pull/12128))
- `[website]` Fix the card front that looks overlapping part of the card back

### Chore & Maintenance
Expand Down
4 changes: 0 additions & 4 deletions packages/jest-worker/src/workers/NodeThreadsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export default class ExperimentalWorker implements WorkerInterface {
JEST_WORKER_ID: String(this._options.workerId + 1), // 0-indexed workerId, 1-indexed JEST_WORKER_ID
},
eval: false,
// Suppress --max_old_space_size flags while preserving others (like --harmony). See https://nodejs.org/api/worker_threads.html#new-workerfilename-options
execArgv: process.execArgv.filter(
v => !/^--(max_old_space_size|max-old-space-size)/.test(v),
),
// @ts-expect-error: added in newer versions
resourceLimits: this._options.resourceLimits,
stderr: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ afterEach(() => {
it('passes fork options down to worker_threads.Worker, adding the defaults', () => {
const thread = require.resolve('../threadChild');

process.execArgv = ['--inspect', '-p'];

// eslint-disable-next-line no-new
new Worker({
forkOptions: {
execArgv: ['--inspect', '-p'],
execPath: 'hello',
},
maxRetries: 3,
Expand Down

0 comments on commit 5ccb0a0

Please sign in to comment.