fix(cli): do not lose live sessions to transient pipe connect failures - #42128
fix(cli): do not lose live sessions to transient pipe connect failures#42128yury-s wants to merge 2 commits into
Conversation
Windows serves bound browsers and CLI daemons over named pipes. Pipe servers pre-post only 4 accept instances (libuv default), replenished only when the server's event loop runs, so a burst of concurrent clients (registry probes, dashboard trackers, `playwright-cli list`) can exhaust the pool and make connects stall or transiently fail. serverRegistry.list() treated any failed probe as a dead session and deleted its registry entry, permanently hiding a live session from the dashboard; `show --annotate -s=<session>` then engaged against the previously selected session. - Set NODE_PENDING_PIPE_INSTANCES=32 for our pipe servers to remove the contention at the source. - Only prune registry entries when the probe fails with ECONNREFUSED or ENOENT, which prove no server is listening; cap the probe with a timeout instead of hanging on a busy pipe. - Align two 5s assertions in the annotate spec with the 15s timeout used for other cross-process waits.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Skn0tt
left a comment
There was a problem hiding this comment.
It's still failing on windows-firefox, so this doesn't seem ready yet.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test results for "MCP"5 failed 8045 passed, 1284 skipped Merge workflow run. |
Test results for "tests 1"5 flaky51232 passed, 1190 skipped Merge workflow run. |
🔴 One failure looks caused by this PRHi, I'm the Playwright bot and I took a look at the CI failures.
DetailsThe latest MCP report (run Caused by this PR
Pre-existing flake (this PR's own target)
Triaged by the Playwright bot - agent run |
|
The Windows CI failures (
The env var change is reverted in this PR until the upstream fix lands. |
Summary
playwright-cli list) can transiently fail to connect.serverRegistry.list()treated any failed probe as a dead session and deleted its registry entry, permanently hiding a live session from the dashboard —show --annotate -s=<session>then engaged against the previously selected session.NODE_PENDING_PIPE_INSTANCES=32for our pipe servers, prune registry entries only on ECONNREFUSED/ENOENT, and cap probes with a timeout instead of hanging on a busy pipe.should switch screencast to -s session on show --annotate(and the#displayvisibility variant) on windows-firefox bots.Recent failures of the test on windows-firefox: