Skip to content

fix(test): time out waiting for worker process to become ready#40873

Closed
ofcRS wants to merge 1 commit into
microsoft:mainfrom
ofcRS:fix-worker-ready-timeout
Closed

fix(test): time out waiting for worker process to become ready#40873
ofcRS wants to merge 1 commit into
microsoft:mainfrom
ofcRS:fix-worker-ready-timeout

Conversation

@ofcRS
Copy link
Copy Markdown
Contributor

@ofcRS ofcRS commented May 16, 2026

Summary

ProcessHost.startRunner awaits a ready event 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 via PWTEST_WORKER_READY_TIMEOUT). On timeout, force-kill the child, emit a processError that 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 ready in milliseconds, far under the 60s default.

Verified locally: a normal run passes; setting PWTEST_WORKER_READY_TIMEOUT=1 produces the expected timeout error and the runner exits cleanly.

`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.
@dgozman
Copy link
Copy Markdown
Collaborator

dgozman commented May 18, 2026

@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!

@dgozman dgozman closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants