-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(jest-worker): fix hanging when workers are killed or unexpectedly exit #13566
Conversation
@@ -372,6 +372,46 @@ export default class ChildProcessWorker | |||
this._child.send(this._request); | |||
} | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this else
branch has gone through several changes in the past.
- This PR added a check for
signal === "SIGABRT"
: fix: when an out of memory event occurs process should exit correctly #13054 - But was removed in a followup PR feat: add workerIdleMemoryLimit to support worker recycling in the event of node >16.11.0 memory leaks #13056
// to situations such as oom-killer attempting to free up system | ||
// resources, retrying would exacerbate the problem. | ||
const isRequestStillPending = !!this._request; | ||
if (isRequestStillPending) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I observed a few tests within Jest fail without the isRequestStillPending
check here. I don't believe this can happen in practice since instances of jest-worker
are usually jest-runner
, which is always sent a request. Some fixture workers in jest-worker
appear to work differently.
Kept the check just in case. It felt safer to only throw an error in situations we're certain something went wrong.
❯ yarn jest WorkerEdgeCases
FAIL packages/jest-worker/src/workers/__tests__/WorkerEdgeCases.test.ts (32.687 s)
✓ workers/processChild.js should exist (1 ms)
✓ workers/threadChild.js should exist
✓ types.js should exist
ProcessWorker
✕ should get memory usage (10003 ms)
✕ should recycle on idle limit breach (10001 ms)
should automatically recycle on idle limit breach
✓ initial state (2 ms)
✓ new worker starts (86 ms)
✓ worker continues to run after kill delay (604 ms)
✓ expected state order (1 ms)
should cleanly exit on out of memory crash
✓ starting state
✓ worker ready
✓ worker crashes and exits (136 ms)
✓ worker stays dead (3 ms)
✓ expected state order
should handle regular fatal crashes
✓ starting state (1 ms)
✓ processes restart (4002 ms)
✓ processes exits (2 ms)
ThreadWorker
✓ should get memory usage (74 ms)
✓ should recycle on idle limit breach (646 ms)
should automatically recycle on idle limit breach
✓ initial state (1 ms)
✓ new worker starts (71 ms)
✓ worker continues to run after kill delay (603 ms)
✓ expected state order (2 ms)
should cleanly exit on out of memory crash
✓ starting state (1 ms)
✓ worker ready (1 ms)
✓ worker crashes and exits (144 ms)
✓ worker stays dead (1 ms)
✓ expected state order
should handle regular fatal crashes
✓ starting state (1 ms)
✓ processes restart (4002 ms)
✓ processes exits (1 ms)
should not hang on external process kill
✓ onEnd callback is called (584 ms)
● ProcessWorker › should get memory usage
TypeError: this._onProcessEnd is not a function
at ChildProcessWorker._onProcessEnd [as _onExit] (packages/jest-worker/src/workers/ChildProcessWorker.ts:410:12)
● ProcessWorker › should get memory usage
thrown: "Exceeded timeout of 10000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
at test (packages/jest-worker/src/workers/__tests__/WorkerEdgeCases.test.ts:111:3)
at Array.forEach (<anonymous>)
● ProcessWorker › should recycle on idle limit breach
TypeError: this._onProcessEnd is not a function
at ChildProcessWorker._onProcessEnd [as _onExit] (packages/jest-worker/src/workers/ChildProcessWorker.ts:410:12)
● ProcessWorker › should recycle on idle limit breach
thrown: "Exceeded timeout of 10000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
at test (packages/jest-worker/src/workers/__tests__/WorkerEdgeCases.test.ts:127:3)
at Array.forEach (<anonymous>)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 30 passed, 32 total
Snapshots: 0 total
Time: 32.854 s
Ran all test suites matching /WorkerEdgeCases/i.
// At this point, it's not clear why the child process exited. There could | ||
// be several reasons: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we can reasonably guess when the Node.js internal max heap limit has been hit, it's difficult to guess other failure scenarios from exitCode
and signal
.
There was a previous discussion of this in the linked issue: #13183 (comment)
I feel propagating an error in the else
block is the best way to handle unknown situations.
4604dff
to
a0703c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff! I guess this doesn't apply to the worker threads version as that doesn't have any subprocesses that can be killed "out of band"?
// In normal operation, the request is handled and cleared before the | ||
// child process exits. If it's still present, it's not clear what | ||
// happened and probably best to throw an error. In practice, this usually | ||
// happens when the child process is killed externally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a better design pattern to guarantee this._request
is handled in some manner. At the moment this happens through a difficult to follow sequence:
- The
this._onMessage
method callsthis._onProcessEnd
. https://github.com/facebook/jest/blob/a0703c94936e2459ae8600a30895da6f6b8b05de/packages/jest-worker/src/workers/ChildProcessWorker.ts#L262-L263 - The
this._onProcessEnd
method setsthis._request
tonull
. It can reasonably do this since the child process sent a successful response. https://github.com/facebook/jest/blob/a0703c94936e2459ae8600a30895da6f6b8b05de/packages/jest-worker/src/workers/ChildProcessWorker.ts#L432-L434
The this._onMessage
has several cases that may or may not call this._onProcessEnd
. Without better guarantees, it's possible a refactor of this class in the future reintroduces the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to take a follow-up if you figure out a better pattern for this. But I think it's fine as is as well
Exactly! Thanks for the fast review btw. |
Hm... I'm thinking this through a bit more and wonder if it's still worth applying the same logic. In theory someone might test a segment of code that unexpectedly calls To double check, I switched the default from And edited the repro to use import { wait } from "./utils/wait";
test("jest-worker exit", async () => {
await wait(2_000);
}, 3_000);
setTimeout(() => {
// Exits the thread and not the process in a worker thread environment
process.exit()
}, 1_000); I'm guessing it's probably better to do: Going to commit that now and update the PR. |
Handling the case of This actually simplifies the new |
Nice! 👍 |
Thanks for the fast review and maintaining Jest @SimenB! ❤️ |
Whoops, I'm late for reviewing. Anyway, looks solid from a quick glimpse |
<h3>Snyk has created this PR to upgrade multiple dependencies.</h3> 👯 The following dependencies are linked and will therefore be updated together. </br></br> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. </br></br> Name | Versions | Released on :-------------|:-------------|:------------- **babel-jest**</br>from 29.1.2 to 29.3.1 | **5 versions** ahead of your current version | **22 days ago**</br>on 2022-11-08 **jest**</br>from 29.1.2 to 29.3.1 | **5 versions** ahead of your current version | **22 days ago**</br>on 2022-11-08 <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>babel-jest</b></summary> <ul> <li> <b>29.3.1</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.3.1">2022-11-08</a></br><h2>Fixes</h2> <ul> <li><code>[jest-config]</code> Do not warn about <code>preset</code> in <code>ProjectConfig</code> <a href="https://snyk.io/redirect/github/facebook/jest/pull/13583" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13583/hovercard">#13583</a></li> </ul> <h2>Performance</h2> <ul> <li><code>[jest-transform]</code> Defer creation of cache directory <a href="https://snyk.io/redirect/github/facebook/jest/pull/13420" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13420/hovercard">#13420</a></li> </ul> </li> <li> <b>29.3.0</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.3.0">2022-11-07</a></br><h2>Features</h2> <ul> <li><code>[jest-runtime]</code> Support WebAssembly (Wasm) imports in ESM modules (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13505" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13505/hovercard">#13505</a>)</li> </ul> <h2>Fixes</h2> <ul> <li><code>[jest-config]</code> Add config validation for <code>projects</code> option (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13565" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13565/hovercard">#13565</a>)</li> <li><code>[jest-mock]</code> Treat cjs modules as objects so they can be mocked (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13513" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13513/hovercard">#13513</a>)</li> <li><code>[jest-worker]</code> Throw an error instead of hanging when jest workers terminate unexpectedly (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13566" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13566/hovercard">#13566</a>)</li> </ul> <h2>Chore & Maintenance</h2> <ul> <li><code>[@ jest/transform]</code> Update <code>convert-source-map</code> (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13509" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13509/hovercard">#13509</a>)</li> <li><code>[docs]</code> Mention <code>toStrictEqual</code> in UsingMatchers docs. (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13560" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13560/hovercard">#13560</a>)</li> </ul> <h2>New Contributors</h2> <ul> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Tofandel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/Tofandel">@ Tofandel</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1422777152" data-permission-text="Title is private" data-url="jestjs/jest#13513" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13513/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13513">#13513</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/RyWilliams/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/RyWilliams">@ RyWilliams</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1424372609" data-permission-text="Title is private" data-url="jestjs/jest#13520" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13520/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13520">#13520</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/waikoo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/waikoo">@ waikoo</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1410500473" data-permission-text="Title is private" data-url="jestjs/jest#13447" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13447/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13447">#13447</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kachkaev/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/kachkaev">@ kachkaev</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1421615843" data-permission-text="Title is private" data-url="jestjs/jest#13505" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13505/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13505">#13505</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ibuibu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/ibuibu">@ ibuibu</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1437401469" data-permission-text="Title is private" data-url="jestjs/jest#13565" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13565/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13565">#13565</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/necipallef/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/necipallef">@ necipallef</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1436721950" data-permission-text="Title is private" data-url="jestjs/jest#13560" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13560/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13560">#13560</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ravshansbox/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/ravshansbox">@ ravshansbox</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1428561971" data-permission-text="Title is private" data-url="jestjs/jest#13533" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13533/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13533">#13533</a></li> </ul> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/facebook/jest/compare/v29.2.2...v29.3.0"><tt>v29.2.2...v29.3.0</tt></a></p> </li> <li> <b>29.2.2</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.2">2022-10-24</a></br><h2>Fixes</h2> <ul> <li><code>[@ jest/test-sequencer]</code> Make sure sharding does not produce empty groups (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13476" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13476/hovercard">#13476</a>)</li> <li><code>[jest-circus]</code> Test marked as <code>todo</code> are shown as todo when inside a focussed describe (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13504" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13504/hovercard">#13504</a>)</li> <li><code>[jest-mock]</code> Ensure mock resolved and rejected values are promises from correct realm (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13503" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13503/hovercard">#13503</a>)</li> <li><code>[jest-snapshot]</code> Don't highlight passing asymmetric property matchers in snapshot diff (<a href="https://snyk.io/redirect/github/facebook/jest/issues/13480" data-hovercard-type="issue" data-hovercard-url="/jestjs/jest/issues/13480/hovercard">#13480</a>)</li> </ul> <h2>Chore & Maintenance</h2> <ul> <li><code>[docs]</code> Update link to Jest 28 upgrade guide in error message (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13483" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13483/hovercard">#13483</a>)</li> <li><code>[jest-runner, jest-watcher]</code> Update <code>emittery</code> (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13490" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13490/hovercard">#13490</a>)</li> </ul> <h2>New Contributors</h2> <ul> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/moonrailgun/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/moonrailgun">@ moonrailgun</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1418595732" data-permission-text="Title is private" data-url="jestjs/jest#13483" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13483/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13483">#13483</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/halldorbjarni/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/halldorbjarni">@ halldorbjarni</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1418768753" data-permission-text="Title is private" data-url="jestjs/jest#13491" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13491/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13491">#13491</a></li> </ul> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/facebook/jest/compare/v29.2.1...v29.2.2"><tt>v29.2.1...v29.2.2</tt></a></p> </li> <li> <b>29.2.1</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.1">2022-10-18</a></br><h2>Features</h2> <ul> <li><code>[@ jest/globals, jest-mock]</code> Add <code>jest.Spied*</code> utility types (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13440" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13440/hovercard">#13440</a>)</li> </ul> <h2>Fixes</h2> <ul> <li><code>[jest-environment-node]</code> make <code>globalThis.performance</code> writable for Node 19 and fake timers (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13467" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13467/hovercard">#13467</a>)</li> <li><code>[jest-mock]</code> Revert <a href="https://snyk.io/redirect/github/facebook/jest/pull/13398" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13398/hovercard">#13398</a> to restore mocking of setters (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13472" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13472/hovercard">#13472</a>)</li> </ul> <h2>Performance</h2> <ul> <li><code>[*]</code> Use sha1 instead of sha256 for hashing (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13421" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13421/hovercard">#13421</a>)</li> </ul> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/facebook/jest/compare/v29.2.0...v29.2.1"><tt>v29.2.0...v29.2.1</tt></a></p> </li> <li> <b>29.2.0</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.0">2022-10-14</a></br><h2>Features</h2> <ul> <li><code>[@ jest/cli, jest-config]</code> A seed for the test run will be randomly generated, or set by a CLI option (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13400" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13400/hovercard">#13400</a>)</li> <li><code>[@ jest/cli, jest-config]</code> <code>--show-seed</code> will display the seed value in the report, and can be set via a CLI flag or through the config file (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13400" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13400/hovercard">#13400</a>)</li> <li><code>[jest-config]</code> Add <code>readInitialConfig</code> utility function (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13356" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13356/hovercard">#13356</a>)</li> <li><code>[jest-core]</code> Allow <code>testResultsProcessor</code> to be async (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13343" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13343/hovercard">#13343</a>)</li> <li><code>[@ jest/environment, jest-environment-node, jest-environment-jsdom, jest-runtime]</code> Add <code>getSeed()</code> to the <code>jest</code> object (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13400" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13400/hovercard">#13400</a>)</li> <li><code>[expect, @ jest/expect-utils]</code> Allow <code>isA</code> utility to take a type argument (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13355" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13355/hovercard">#13355</a>)</li> <li><code>[expect]</code> Expose <code>AsyncExpectationResult</code> and <code>SyncExpectationResult</code> types (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13411" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13411/hovercard">#13411</a>)</li> </ul> <h2>Fixes</h2> <ul> <li><code>[babel-plugin-jest-hoist]</code> Ignore <code>TSTypeQuery</code> when checking for hoisted references (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13367" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13367/hovercard">#13367</a>)</li> <li><code>[jest-core]</code> Fix <code>detectOpenHandles</code> false positives for some special objects such as <code>TLSWRAP</code> (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13414" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13414/hovercard">#13414</a>)</li> <li><code>[jest-mock]</code> Fix mocking of getters and setters on classes (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13398" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13398/hovercard">#13398</a>)</li> <li><code>[jest-reporters]</code> Revert: Transform file paths into hyperlinks (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13399" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13399/hovercard">#13399</a>)</li> <li><code>[@ jest/types]</code> Infer type of <code>each</code> table correctly when the table is a tuple or array (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13381" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13381/hovercard">#13381</a>)</li> <li><code>[@ jest/types]</code> Rework typings to allow the <code>*ReturnedWith</code> matchers to be called with no argument (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13385" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13385/hovercard">#13385</a>)</li> </ul> <h2>Chore & Maintenance</h2> <ul> <li><code>[*]</code> Update <code>@ babel/*</code> deps, resulting in slightly different stack traces for <code>each</code> (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13422" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13422/hovercard">#13422</a>)</li> </ul> <h2>Performance</h2> <ul> <li><code>[jest-runner]</code> Do not instrument v8 coverage data if coverage should not be collected (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13282" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13282/hovercard">#13282</a>)</li> </ul> <h2>New Contributors</h2> <ul> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/johannessjoberg/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/johannessjoberg">@ johannessjoberg</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1392370848" data-permission-text="Title is private" data-url="jestjs/jest#13343" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13343/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13343">#13343</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mitchhentgesspotify/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/mitchhentgesspotify">@ mitchhentgesspotify</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1378178654" data-permission-text="Title is private" data-url="jestjs/jest#13282" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13282/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13282">#13282</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Methuselah96/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/Methuselah96">@ Methuselah96</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1401960828" data-permission-text="Title is private" data-url="jestjs/jest#13409" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13409/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13409">#13409</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jhwang98/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/jhwang98">@ jhwang98</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1401011982" data-permission-text="Title is private" data-url="jestjs/jest#13400" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13400/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13400">#13400</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/professorjrod/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/professorjrod">@ professorjrod</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1402520759" data-permission-text="Title is private" data-url="jestjs/jest#13418" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13418/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13418">#13418</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jesusarell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/jesusarell">@ jesusarell</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1401930513" data-permission-text="Title is private" data-url="jestjs/jest#13407" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13407/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13407">#13407</a></li> </ul> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/facebook/jest/compare/v29.1.2...v29.2.0"><tt>v29.1.2...v29.2.0</tt></a></p> </li> <li> <b>29.1.2</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.1.2">2022-09-30</a></br><h2>Fixes</h2> <ul> <li><code>[expect, @ jest/expect]</code> Revert buggy inference of argument types for <code>*CalledWith</code> and <code>*ReturnedWith</code> matchers introduced in 29.1.0 (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13339" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13339/hovercard">#13339</a>)</li> <li><code>[jest-worker]</code> Add missing dependency on <code>jest-util</code> (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13341" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13341/hovercard">#13341</a>)</li> </ul> <h2>New Contributors</h2> <ul> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/brunocabral88/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/brunocabral88">@ brunocabral88</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1388869458" data-permission-text="Title is private" data-url="jestjs/jest#13329" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13329/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13329">#13329</a></li> <li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alexander-akait/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://snyk.io/redirect/github/alexander-akait">@ alexander-akait</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1391618696" data-permission-text="Title is private" data-url="jestjs/jest#13341" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13341/hovercard" href="https://snyk.io/redirect/github/facebook/jest/pull/13341">#13341</a></li> </ul> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/facebook/jest/compare/v29.1.1...v29.1.2"><tt>v29.1.1...v29.1.2</tt></a></p> </li> </ul> from <a href="https://snyk.io/redirect/github/facebook/jest/releases">babel-jest GitHub release notes</a> </details> <details> <summary>Package name: <b>jest</b></summary> <ul> <li> <b>29.3.1</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.3.1">2022-11-08</a></br><h2>Fixes</h2> <ul> <li><code>[jest-config]</code> Do not warn about <code>preset</code> in <code>ProjectConfig</code> <a href="https://snyk.io/redirect/github/facebook/jest/pull/13583" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13583/hovercard">#13583</a></li> </ul> <h2>Performance</h2> <ul> <li><code>[jest-transform]</code> Defer creation of cache directory <a href="https://snyk.io/redirect/github/facebook/jest/pull/13420" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13420/hovercard">#13420</a></li> </ul> </li> <li> <b>29.3.0</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.3.0">2022-11-07</a></br><a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.3.0"> Read more </a> </li> <li> <b>29.2.2</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.2">2022-10-24</a></br><a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.2"> Read more </a> </li> <li> <b>29.2.1</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.1">2022-10-18</a></br><h2>Features</h2> <ul> <li><code>[@ jest/globals, jest-mock]</code> Add <code>jest.Spied*</code> utility types (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13440" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13440/hovercard">#13440</a>)</li> </ul> <h2>Fixes</h2> <ul> <li><code>[jest-environment-node]</code> make <code>globalThis.performance</code> writable for Node 19 and fake timers (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13467" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13467/hovercard">#13467</a>)</li> <li><code>[jest-mock]</code> Revert <a href="https://snyk.io/redirect/github/facebook/jest/pull/13398" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13398/hovercard">#13398</a> to restore mocking of setters (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13472" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13472/hovercard">#13472</a>)</li> </ul> <h2>Performance</h2> <ul> <li><code>[*]</code> Use sha1 instead of sha256 for hashing (<a href="https://snyk.io/redirect/github/facebook/jest/pull/13421" data-hovercard-type="pull_request" data-hovercard-url="/jestjs/jest/pull/13421/hovercard">#13421</a>)</li> </ul> <p><strong>Full Changelog</strong>: <a class="commit-link" href="https://snyk.io/redirect/github/facebook/jest/compare/v29.2.0...v29.2.1"><tt>v29.2.0...v29.2.1</tt></a></p> </li> <li> <b>29.2.0</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.0">2022-10-14</a></br><a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.2.0"> Read more </a> </li> <li> <b>29.1.2</b> - <a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.1.2">2022-09-30</a></br><a href="https://snyk.io/redirect/github/facebook/jest/releases/tag/v29.1.2"> Read more </a> </li> </ul> from <a href="https://snyk.io/redirect/github/facebook/jest/releases">jest GitHub release notes</a> </details> </details> <details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>babel-jest</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/05deb8393c4ad71e19be2567b704dfd3a2ab5fc9">05deb83</a> v29.3.1</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/5b38cfb3fcc12eecc110381ae3d9d7c6bff07d06">5b38cfb</a> chore: update changelog for release</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/291f2016af13269d2128d4905459ab4082c07721">291f201</a> fix(jest-config): do not warn about presets in project config (#13583)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/dfc87111e708b9294dc54ab0c17712972d042c1c">dfc8711</a> chore: use `@ fast-check/jest` (#13493)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/b027fb0791c28dfe8c6206fc77286b90ab70d243">b027fb0</a> ci: remove git credentials after checkout (#13574)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/1c3565f6e5d6a8e987417f688004f340d9bfcb72">1c3565f</a> Defer creation of cache directory (#13420)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/ba20c150df6cd3c3a73a0a700d000e6cd7778a19">ba20c15</a> refactor(jest-mock): clean up internal typings more (#13575)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/a570638d6325dac0a52034ce0d208790af3fcf1a">a570638</a> website: build on node 16 since 18 is broken</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/a83e8edb44722d0de1cdc6af956f9e482650dc3c">a83e8ed</a> refactor(jest-mock): clean up internal typings (#13571)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/84b8de987b33e2da20dc833aeb65f23d72a673cd">84b8de9</a> v29.3.0</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/2bc237704d19da87a4949b2b609a429c23473031">2bc2377</a> chore: roll new version of the docs</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/6e24f3188252397213c23a6655d3772da793887a">6e24f31</a> chore: update changelog for release</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/c2046d5d306a8e54e95a701ab04f54c50b793488">c2046d5</a> chore(docs): fix even more prettier violations</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/35fd91d876395292cb59379603eb8c12cb8e21fa">35fd91d</a> chore: fix lint issue introduced in #13556 (#13569)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/fb4f48764ed975b6386e43005af644b8bb53e7a8">fb4f487</a> docs: correct grammar in GettingStarted.md (#13533)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/fb2daf49f3a5a819a479ef825409ef94458ae67f">fb2daf4</a> docs: add explanation for `supportsStaticESM` transform option (#12028)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/73550fd12e3a6ca870f5fe62022d51f33680f5e1">73550fd</a> Doc: Update documentation on usage with Webpack (#13556)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/491827b9310d5dc61f64a8b06427bad5a22c13bc">491827b</a> docs: usingMatchers mention toStrictEqual (#13560)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/f75a3aa988d61036331df00b07e4311bb06985a6">f75a3aa</a> fix: config silently ignored in projects (#13565)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/195cb4b24f6cdce5a8a77851387cfe883fb39763">195cb4b</a> fix(jest-worker): fix hanging when workers are killed or unexpectedly exit (#13566)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/6483979d6f1c1d7d078dd6c049d31701a5b9f2db">6483979</a> feat: support WebAssembly (Wasm) imports in ESM modules (#13505)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/7c48c4c6d36661fd4425acedc87faff69f4b54c4">7c48c4c</a> refactor(jest-reporters): remove useless conditional (#13564)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/bb28e7962b85caa861eb95431c52c7297947c981">bb28e79</a> refactor(jest-mock): remove useless conditional (#13561)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/4670d3be0d80d47844673eb163666253e788f006">4670d3b</a> chore(deps-dev): bump which from 2.0.2 to 3.0.0 (#13554)</li> </ul> <a href="https://snyk.io/redirect/github/facebook/jest/compare/3c31dd619e8c022cde53f40fa12ea2a67f4752ce...05deb8393c4ad71e19be2567b704dfd3a2ab5fc9">Compare</a> </details> <details> <summary>Package name: <b>jest</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/05deb8393c4ad71e19be2567b704dfd3a2ab5fc9">05deb83</a> v29.3.1</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/5b38cfb3fcc12eecc110381ae3d9d7c6bff07d06">5b38cfb</a> chore: update changelog for release</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/291f2016af13269d2128d4905459ab4082c07721">291f201</a> fix(jest-config): do not warn about presets in project config (#13583)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/dfc87111e708b9294dc54ab0c17712972d042c1c">dfc8711</a> chore: use `@ fast-check/jest` (#13493)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/b027fb0791c28dfe8c6206fc77286b90ab70d243">b027fb0</a> ci: remove git credentials after checkout (#13574)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/1c3565f6e5d6a8e987417f688004f340d9bfcb72">1c3565f</a> Defer creation of cache directory (#13420)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/ba20c150df6cd3c3a73a0a700d000e6cd7778a19">ba20c15</a> refactor(jest-mock): clean up internal typings more (#13575)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/a570638d6325dac0a52034ce0d208790af3fcf1a">a570638</a> website: build on node 16 since 18 is broken</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/a83e8edb44722d0de1cdc6af956f9e482650dc3c">a83e8ed</a> refactor(jest-mock): clean up internal typings (#13571)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/84b8de987b33e2da20dc833aeb65f23d72a673cd">84b8de9</a> v29.3.0</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/2bc237704d19da87a4949b2b609a429c23473031">2bc2377</a> chore: roll new version of the docs</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/6e24f3188252397213c23a6655d3772da793887a">6e24f31</a> chore: update changelog for release</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/c2046d5d306a8e54e95a701ab04f54c50b793488">c2046d5</a> chore(docs): fix even more prettier violations</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/35fd91d876395292cb59379603eb8c12cb8e21fa">35fd91d</a> chore: fix lint issue introduced in #13556 (#13569)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/fb4f48764ed975b6386e43005af644b8bb53e7a8">fb4f487</a> docs: correct grammar in GettingStarted.md (#13533)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/fb2daf49f3a5a819a479ef825409ef94458ae67f">fb2daf4</a> docs: add explanation for `supportsStaticESM` transform option (#12028)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/73550fd12e3a6ca870f5fe62022d51f33680f5e1">73550fd</a> Doc: Update documentation on usage with Webpack (#13556)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/491827b9310d5dc61f64a8b06427bad5a22c13bc">491827b</a> docs: usingMatchers mention toStrictEqual (#13560)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/f75a3aa988d61036331df00b07e4311bb06985a6">f75a3aa</a> fix: config silently ignored in projects (#13565)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/195cb4b24f6cdce5a8a77851387cfe883fb39763">195cb4b</a> fix(jest-worker): fix hanging when workers are killed or unexpectedly exit (#13566)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/6483979d6f1c1d7d078dd6c049d31701a5b9f2db">6483979</a> feat: support WebAssembly (Wasm) imports in ESM modules (#13505)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/7c48c4c6d36661fd4425acedc87faff69f4b54c4">7c48c4c</a> refactor(jest-reporters): remove useless conditional (#13564)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/bb28e7962b85caa861eb95431c52c7297947c981">bb28e79</a> refactor(jest-mock): remove useless conditional (#13561)</li> <li><a href="https://snyk.io/redirect/github/facebook/jest/commit/4670d3be0d80d47844673eb163666253e788f006">4670d3b</a> chore(deps-dev): bump which from 2.0.2 to 3.0.0 (#13554)</li> </ul> <a href="https://snyk.io/redirect/github/facebook/jest/compare/3c31dd619e8c022cde53f40fa12ea2a67f4752ce...05deb8393c4ad71e19be2567b704dfd3a2ab5fc9">Compare</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmZmUwYjFkZi0yMzY2LTRiOGYtOTg5MC03YmQ1NDgwNjMwYTgiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZmZTBiMWRmLTIzNjYtNGI4Zi05ODkwLTdiZDU0ODA2MzBhOCJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55/settings/integration?pkg=babel-jest&pkg=jest&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"ffe0b1df-2366-4b8f-9890-7bd5480630a8","prPublicId":"ffe0b1df-2366-4b8f-9890-7bd5480630a8","dependencies":[{"name":"babel-jest","from":"29.1.2","to":"29.3.1"},{"name":"jest","from":"29.1.2","to":"29.3.1"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/sandbox-2ba/project/852e6e4f-be96-45c8-b370-1060f5ebee55?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"852e6e4f-be96-45c8-b370-1060f5ebee55","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":5,"publishedDate":"2022-11-08T22:56:28.239Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> Co-authored-by: snyk-bot <snyk-bot@snyk.io>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes #13183.
Before
Before this change, if a Jest worker process is killed externally (e.g. through
kill <PID>
), the Jest test harness is never informed and the test runs forever. This happens even if a finite timeout (default 5s) is set.For my team specifically, we were observing OOM-killer on Linux kill
jest-worker
processes and cause CI tests to hang forever. Since OOM-killer is included on all Linux distributions, I believe this bug affects any users of Jest on Linux.This was difficult to root cause since there were no logs of the failure. Once we realized more memory was required on CI for our project, we bumped our container's memory limit. Previously hanging tests completed successfully from there.
After
After the change in this PR, the test above exits with an error. See https://github.com/gluxon/test-jest-worker-killed-repro for the source code of this repro.
Although the scenarios in which a
jest-worker
running in a thread (rather than a subprocess) exit unexpectedly are much rarer, this situation was handled as well in the PR for consistency.Test plan
This change contains a new test. Before the fix, the test fails with:
Execution
After the fix, the test passes: