jest-worker
Advanced tools
Comparing version 21.3.0-beta.4 to 21.3.0-beta.5
@@ -71,2 +71,3 @@ /** | ||
forkOptions: options.forkOptions || {}, | ||
maxRetries: options.maxRetries || 3, | ||
workerPath }; | ||
@@ -73,0 +74,0 @@ |
@@ -50,2 +50,4 @@ /** | ||
// Messages passed from the parent to the children. | ||
@@ -52,0 +54,0 @@ |
@@ -54,2 +54,3 @@ /** | ||
constructor(options) { | ||
@@ -95,4 +96,20 @@ this._options = options; | ||
this._retries++; | ||
this._child = child; | ||
this._busy = false; | ||
// If we exceeded the amount of retries, we will emulate an error reply | ||
// 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'); | ||
this._receive([(_types || _load_types()).PARENT_MESSAGE_ERROR, | ||
error.name, | ||
error.message, | ||
error.stack, | ||
{ type: 'WorkerError' }]); | ||
} | ||
} | ||
@@ -124,3 +141,5 @@ | ||
this._retries = 0; | ||
this._busy = true; | ||
// $FlowFixMe: wrong "ChildProcess.send" signature. | ||
@@ -127,0 +146,0 @@ this._child.send(call.request); |
{ | ||
"name": "jest-worker", | ||
"version": "21.3.0-beta.4", | ||
"version": "21.3.0-beta.5", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -62,2 +62,6 @@ # jest-worker | ||
#### `maxRetries: number` (optional) | ||
Maximum amount of times that a dead child can be re-spawned, per call. Defaults to `3`, pass `Infinity` to allow endless retries. | ||
#### `forkOptions: Object` (optional) | ||
@@ -64,0 +68,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
194
4
2
25451
7
374