From 705af6854e2f4b32775d65bb06a30c596fad5612 Mon Sep 17 00:00:00 2001 From: Tyler Gould <4130722+scitech@users.noreply.github.com> Date: Fri, 7 May 2021 16:12:04 -0500 Subject: [PATCH] Improve fatal worker error message (#11381) --- e2e/__tests__/fatalWorkerError.test.ts | 4 +++- packages/jest-worker/src/workers/ChildProcessWorker.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/e2e/__tests__/fatalWorkerError.test.ts b/e2e/__tests__/fatalWorkerError.test.ts index 92acb18139bf..477932738da0 100644 --- a/e2e/__tests__/fatalWorkerError.test.ts +++ b/e2e/__tests__/fatalWorkerError.test.ts @@ -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', + ); }); diff --git a/packages/jest-worker/src/workers/ChildProcessWorker.ts b/packages/jest-worker/src/workers/ChildProcessWorker.ts index ba47862cadfe..4643b19fdf5a 100644 --- a/packages/jest-worker/src/workers/ChildProcessWorker.ts +++ b/packages/jest-worker/src/workers/ChildProcessWorker.ts @@ -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,