Skip to content

Commit 5ccb0a0

Browse files
[jest-worker] Don't crash when running node with flags disallowed in workers (#12128)
1 parent f8887d5 commit 5ccb0a0

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixes
66

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

1011
### Chore & Maintenance

packages/jest-worker/src/workers/NodeThreadsWorker.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ export default class ExperimentalWorker implements WorkerInterface {
6565
JEST_WORKER_ID: String(this._options.workerId + 1), // 0-indexed workerId, 1-indexed JEST_WORKER_ID
6666
},
6767
eval: false,
68-
// Suppress --max_old_space_size flags while preserving others (like --harmony). See https://nodejs.org/api/worker_threads.html#new-workerfilename-options
69-
execArgv: process.execArgv.filter(
70-
v => !/^--(max_old_space_size|max-old-space-size)/.test(v),
71-
),
7268
// @ts-expect-error: added in newer versions
7369
resourceLimits: this._options.resourceLimits,
7470
stderr: true,

packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ afterEach(() => {
5454
it('passes fork options down to worker_threads.Worker, adding the defaults', () => {
5555
const thread = require.resolve('../threadChild');
5656

57-
process.execArgv = ['--inspect', '-p'];
58-
5957
// eslint-disable-next-line no-new
6058
new Worker({
6159
forkOptions: {
60+
execArgv: ['--inspect', '-p'],
6261
execPath: 'hello',
6362
},
6463
maxRetries: 3,

0 commit comments

Comments
 (0)