Skip to content

Commit

Permalink
Improve fatal worker error message (#11381)
Browse files Browse the repository at this point in the history
  • Loading branch information
scitech committed May 7, 2021
1 parent a2f1700 commit 705af68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion e2e/__tests__/fatalWorkerError.test.ts
Expand Up @@ -41,5 +41,7 @@ test('fails a test that terminates the worker with a fatal error', () => {
expect(exitCode).not.toBe(0);
expect(numberOfTestsPassed).toBe(Object.keys(testFiles).length - 1);
expect(stderr).toContain('FAIL __tests__/fatalWorkerError.test.js');
expect(stderr).toContain('Call retries were exceeded');
expect(stderr).toContain(
'Jest worker encountered 4 child process exceptions, exceeding retry limit',
);
});
4 changes: 3 additions & 1 deletion packages/jest-worker/src/workers/ChildProcessWorker.ts
Expand Up @@ -134,7 +134,9 @@ export default class ChildProcessWorker implements WorkerInterface {
// coming from the child. This avoids code duplication related with cleaning
// the queue, and scheduling the next call.
if (this._retries > this._options.maxRetries) {
const error = new Error('Call retries were exceeded');
const error = new Error(
`Jest worker encountered ${this._retries} child process exceptions, exceeding retry limit`,
);

this._onMessage([
PARENT_MESSAGE_CLIENT_ERROR,
Expand Down

0 comments on commit 705af68

Please sign in to comment.