-
-
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
Unhandled ERR_IPC_CHANNEL_CLOSED exception and a deadlock in jest-worker #11143
Comments
The detailed description is at jestjs#11143.
@SimenB could you be so kind to have a look? I want to be sure I properly grasped the problem and the fix is correct. |
This looks good to me! @jeysal thoughts? |
Yeah, seems good. Probably almost impossible to write a regression test for? So might have to merge it and hope no one breaks it in the future 🙈 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
An unhandled
ERR_IPC_CHANNEL_CLOSED
exception can be thrown while callingawait worker.end()
. Follow<<<<<<<<<<<<<<<<<<<<<<<<
in the code:The
target.send
function emits an error when the callback is not passed via the second argument. Jest calls it without any callback:this._child.send(request);
. The error claims:Ok, that can be fixed by passing
console.error
or() => {}
. Let's get back toBaseWorkerPool.js
. We call thenforceExit()
method and start awaiting forworker.waitForExit();
.At this point, I observe an everlasting program execution. Let's assume
this._exitPromise
is never resolved, that is becausethis._resolveExitPromise
is never called. The only place where it is called is_onExit(exitCode)
:}
_shutdown() {
// End the temporary streams so the merged streams end too
if (this._fakeStream) {
this._fakeStream.end();
}
What if
_onExit
is called with thenull
argument? Node.js documentation assures such cases, so we needexitCode !== null
clause.The text was updated successfully, but these errors were encountered: