test(mcp): diagnose startup stalls (do not merge)#41947
Conversation
Copilot-Session: b62093c2-7f1f-46d8-9f9a-be7e30a965ab
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Split Chromium connection and navigation startup into individual diagnostic phases so the next sampled CI run can identify the exact stalled operation. Limit matrix concurrency to reduce hosted-runner fleet pressure. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b62093c2-7f1f-46d8-9f9a-be7e30a965ab
Stop traced Ubuntu jobs before the hosted VM loses communication, and retain resource telemetry alongside the partial startup timelines. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b62093c2-7f1f-46d8-9f9a-be7e30a965ab
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b62093c2-7f1f-46d8-9f9a-be7e30a965ab
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Retain Perfetto traces when startup timeline phases exceed five seconds, and recover partial traces after worker timeouts for CI artifact upload. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b62093c2-7f1f-46d8-9f9a-be7e30a965ab
Test results for "MCP startup diagnostic (temporary)"1 failed 19479 passed, 1430 skipped Merge workflow run. |
🟡 One failure — I can't certify it, but nothing points at this PRHi, I'm the Playwright bot and I took a first look at the CI failures. The latest merged report (run 30100485338) has one red: DetailsThis is a diagnostic PR: it adds Uncertain
Triaged by the Playwright bot - agent run |
Caution
Temporary diagnostic PR. Do not merge as-is.
This adds a
PWTEST_MCP_STARTUP_TRACE-gated JSONL timeline around MCP CLI, daemon, browser, registry and dashboard startup. The fixture retains one file per test and uploads it even when the test times out.The corrected 30-job run localises the delays to Chromium servicing its earliest protocol work:
opentook 1.7-16.2s across ten fresh runners (8.8s median). The firstBrowser.getVersionresponse took 0.8-11.0s (6.1s median).opentook 4.0-11.7s andBrowser.getVersionaccounted for up to 9.9s.showtook 35.9s: 10.3s launching the persistent browser, including 8.5s waiting for its initial page, then 25.2s in dashboardpage.goto. Of that, 25.0s was insidePage.navigatebefore Chromium issued the first HTTP request.The surrounding machinery is fast across the run: daemon spawn p95 7ms, browser process spawn p95 12ms, dashboard HTTP readiness p95 47ms, registry publication p95 6ms, browser bind p95 5ms and browser teardown p95 3ms. This rules out the CLI/daemon connection, dashboard HTTP server, registry publication and teardown as the source of the 29-38s stalls.
The earlier Ubuntu runner losses were caused by the diagnostic itself. Cleanup killed the process group of an observed, non-detached MCP server PID; on Linux that group also contained npm and the test runner. The corrected run completed all ten Ubuntu jobs. Resource telemetry stayed healthy throughout: roughly 14 GB available RAM, no swap movement, stable process counts and modest load.
28/30 jobs passed. Windows Chrome sample 9 hit an unrelated existing CLI assertion. Windows Edge sample 9 timed out while the 25.2s dashboard navigation above was still running.
So the useful conclusion is: this is browser-side, after Chromium has spawned and the pipe transport exists. The trace does not tell us whether Chromium itself is blocked or the hosted VM is delaying it through scheduling, storage or antivirus work. This PR remains diagnostic and must not merge as-is.