fix(test): time out waiting for worker process to become ready#40873
Closed
ofcRS wants to merge 1 commit into
Closed
fix(test): time out waiting for worker process to become ready#40873ofcRS wants to merge 1 commit into
ofcRS wants to merge 1 commit into
Conversation
`ProcessHost.startRunner` awaits a `ready` event from the freshly
forked worker with no upper bound. When the worker hangs before it can
call `process.send({ method: 'ready' })` — e.g. crash during preload,
sandboxed container with a filtered IPC fd, or any other reason the
child never reaches the message channel — the parent waits forever and
the test run appears stuck with no diagnostic output.
Wrap the wait with raceAgainstDeadline (60s, overridable via
PWTEST_WORKER_READY_TIMEOUT). On timeout, force-kill the child, emit
a processError pointing at the env var, and surface the failure as a
normal worker exit so the run terminates with a clear error instead
of hanging.
Behavior on the happy path is unchanged: workers that fork and send
ready well under the timeout (milliseconds in practice) see no
difference.
Collaborator
|
@ofcRS Please file an issue first per contributing guide. We can reopen the PR once the issue is triaged and the right approach to fix it is established. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProcessHost.startRunnerawaits areadyevent from the freshly forked worker with no upper bound. If the worker never reaches the message channel — e.g. a preload crash, a sandboxed container that filters the IPC fd, or any other startup hang — the parent waits forever and the test run hangs with no diagnostic output.Wrap the wait in
raceAgainstDeadline(60s, overridable viaPWTEST_WORKER_READY_TIMEOUT). On timeout, force-kill the child, emit aprocessErrorthat points at the env var, and surface the failure as a normal worker exit so the run terminates with a clear, actionable error instead of hanging silently.Behavior on the happy path is unchanged — workers normally reach
readyin milliseconds, far under the 60s default.Verified locally: a normal run passes; setting
PWTEST_WORKER_READY_TIMEOUT=1produces the expected timeout error and the runner exits cleanly.