fix(dashboard): don't evict live registration on a transient probe#41895
Closed
microsoft-playwright-automation[bot] wants to merge 1 commit into
Closed
fix(dashboard): don't evict live registration on a transient probe#41895microsoft-playwright-automation[bot] wants to merge 1 commit into
microsoft-playwright-automation[bot] wants to merge 1 commit into
Conversation
The mcp/annotate.spec.ts suite flakes on macOS bots: `connectToDashboard`
polls `cli list` until the dashboard app registers, but occasionally the
registration vanishes for good and the poll never recovers ("dashboard app
... is not registered yet" / undefined `endpoint`).
Root cause: `serverRegistry.list()` probes each descriptor with a single
`net.connect` and unlinks the descriptor file the moment one probe fails.
Under CI contention a live endpoint can transiently refuse/reset a
connection (listen backlog, daemon mid-cold-start), so a healthy dashboard
registration gets permanently deleted from disk — every later `list` then
reports it missing. This is deeper than the poll cadence #41894 addressed.
Fix the probe to retry a few times with a short per-attempt timeout before
declaring the endpoint dead. A truly gone endpoint keeps failing fast and is
still evicted; a busy one recovers and stays registered.
DB evidence (from #41894, rolling window, macOS bots, expected=passed): every
test in mcp/annotate.spec.ts flakes on mcp-macos-* bots. Top offenders on
mcp-macos-latest-firefox (317 runs): "downloads zip with feedback.md" 21 fails
(6.6%), "switch screencast to -s session" 20 (6.3%), "disengage annotate mode
when client disconnects" 19 (6.0%), "abort annotation when last screenshot is
removed" 18 (5.7%) — all the same endpoint TypeError on test timeout. #41894's
macOS Chromium/Chrome jobs still failed with the same symptom.
Verified locally on macOS 15 (Arm64):
- New deterministic regression test tests/library/unit/server-registry.spec.ts:
a registration whose first probe fails but whose endpoint comes up mid-retry
survives; one that never becomes reachable is still evicted. Passes on
chromium/firefox/webkit-library.
- npm run test-mcp -- --project=chromium tests/mcp/annotate.spec.ts:110
--repeat-each=3 --workers=2 — 3/3 passed.
- npm run flint — clean.
Ref: #41894
CI run: https://github.com/microsoft/playwright/actions/runs/29817954196
Suggested-reviewer: Skn0tt
Contributor
Test results for "MCP"1 failed 7759 passed, 1249 skipped Merge workflow run. |
Contributor
Test results for "tests 1"5 flaky50003 passed, 1189 skipped Merge workflow run. |
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.
The mcp/annotate.spec.ts suite flakes on macOS bots:
connectToDashboardpolls
cli listuntil the dashboard app registers, but occasionally theregistration vanishes for good and the poll never recovers ("dashboard app
... is not registered yet" / undefined
endpoint).Root cause:
serverRegistry.list()probes each descriptor with a singlenet.connectand unlinks the descriptor file the moment one probe fails.Under CI contention a live endpoint can transiently refuse/reset a
connection (listen backlog, daemon mid-cold-start), so a healthy dashboard
registration gets permanently deleted from disk — every later
listthenreports it missing. This is deeper than the poll cadence #41894 addressed.
Fix the probe to retry a few times with a short per-attempt timeout before
declaring the endpoint dead. A truly gone endpoint keeps failing fast and is
still evicted; a busy one recovers and stays registered.
DB evidence (from #41894, rolling window, macOS bots, expected=passed): every
test in mcp/annotate.spec.ts flakes on mcp-macos-* bots. Top offenders on
mcp-macos-latest-firefox (317 runs): "downloads zip with feedback.md" 21 fails
(6.6%), "switch screencast to -s session" 20 (6.3%), "disengage annotate mode
when client disconnects" 19 (6.0%), "abort annotation when last screenshot is
removed" 18 (5.7%) — all the same endpoint TypeError on test timeout. #41894's
macOS Chromium/Chrome jobs still failed with the same symptom.
Verified locally on macOS 15 (Arm64):
a registration whose first probe fails but whose endpoint comes up mid-retry
survives; one that never becomes reachable is still evicted. Passes on
chromium/firefox/webkit-library.
--repeat-each=3 --workers=2 — 3/3 passed.
Ref: #41894
CI run: https://github.com/microsoft/playwright/actions/runs/29817954196
Suggested-reviewer: Skn0tt