Skip to content

Commit 705af68

Browse files
authored
Improve fatal worker error message (#11381)
1 parent a2f1700 commit 705af68

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

e2e/__tests__/fatalWorkerError.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ test('fails a test that terminates the worker with a fatal error', () => {
4141
expect(exitCode).not.toBe(0);
4242
expect(numberOfTestsPassed).toBe(Object.keys(testFiles).length - 1);
4343
expect(stderr).toContain('FAIL __tests__/fatalWorkerError.test.js');
44-
expect(stderr).toContain('Call retries were exceeded');
44+
expect(stderr).toContain(
45+
'Jest worker encountered 4 child process exceptions, exceeding retry limit',
46+
);
4547
});

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ export default class ChildProcessWorker implements WorkerInterface {
134134
// coming from the child. This avoids code duplication related with cleaning
135135
// the queue, and scheduling the next call.
136136
if (this._retries > this._options.maxRetries) {
137-
const error = new Error('Call retries were exceeded');
137+
const error = new Error(
138+
`Jest worker encountered ${this._retries} child process exceptions, exceeding retry limit`,
139+
);
138140

139141
this._onMessage([
140142
PARENT_MESSAGE_CLIENT_ERROR,

0 commit comments

Comments
 (0)