Skip to content

test(mcp): work around Chromium losing WebMCP tools in same-origin iframes - #42888

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:fix-42869
Sep 24, 2026
Merged

Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:fix-42869

Conversation

@dgozman

Copy link
Copy Markdown
Collaborator

Summary

  • Chromium reuses the initial empty document's window, and its browser interface pipe, for an iframe's first same-origin navigation. Tools registered while parsing race the navigation commit in the browser process and are sometimes lost, with getTools() never resolving in that frame.
  • The three iframe tests now reload the frame once on first load, so the second document registers its tools reliably.

Fixes #42869

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/idle-timeout.spec.ts:19 › closes the browser after the idle timeout and relaunches it on the next call @mcp-windows-latest-firefox

8704 passed, 1474 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 The one failure is a pre-existing flake — this PR is clear

Hi, I'm the Playwright bot and I triaged the failing CI run.

[firefox] › mcp/idle-timeout.spec.ts:19 is a known flake on the mcp-windows-latest-firefox bot: it has failed 6 of 229 runs (2.6%) in the aggregated CI results, on five other PRs with the same error. This PR only edits tests/mcp/cli-webmcp.spec.ts, so it can't reach it.

Details

This PR changes a single test file — tests/mcp/cli-webmcp.spec.ts, +9/-3 — with no product code touched. Nothing it changes is shared with mcp/idle-timeout.spec.ts, and everything else in the report is green (8704 passed, 1474 skipped).

Pre-existing flake / infra

Triaged by the Playwright bot - agent run

@dgozman
Dmitry Gozman (dgozman) merged commit 8db9ed7 into microsoft:main Sep 24, 2026
16 of 17 checks passed
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.

[Bug]: flaky: cli-webmcp iframe tests intermittently miss the iframe's tools on Linux/macOS Chrome

2 participants