Skip to content

fix(e2e): poll the live tool count instead of reading it once - #530

Merged
codyllord merged 1 commit into
developfrom
fix/mcp-e2e-live-count-race
Sep 22, 2026
Merged

codyllord merged 1 commit into
developfrom
fix/mcp-e2e-live-count-race

Conversation

@codyllord

Copy link
Copy Markdown
Contributor

"list -> open the MCP server lands on Connect with URL, probe and live count" fails on develop with Expected: 22, Received: 6.

The header chip renders as soon as the editor does, showing the count the store can compute before the backend-services fetch has landed — globals and custom tools only. The test read it once, with textContent(), and compared that first paint against the settled model, so it raced the fetch and lost. The Tools tab tests do not hit this because openToolsTab() waits for .mcp-tools-loading to clear first.

Read the chip through expect.poll so the assertion retries until the catalog arrives, and assert the model is non-trivial separately rather than inferring it from the racing read. numberFrom() is left alone for the callers that read values which are settled by the time they run.

"list -> open the MCP server lands on Connect with URL, probe and live count"
fails on develop with Expected: 22, Received: 6.

The header chip renders as soon as the editor does, showing the count the
store can compute before the backend-services fetch has landed — globals and
custom tools only. The test read it once, with textContent(), and compared
that first paint against the settled model, so it raced the fetch and lost.
The Tools tab tests do not hit this because openToolsTab() waits for
.mcp-tools-loading to clear first.

Read the chip through expect.poll so the assertion retries until the catalog
arrives, and assert the model is non-trivial separately rather than inferring
it from the racing read. numberFrom() is left alone for the callers that read
values which are settled by the time they run.
@codyllord
codyllord merged commit 40b7759 into develop Sep 22, 2026
1 check passed
@codyllord
codyllord deleted the fix/mcp-e2e-live-count-race branch September 22, 2026 23:46
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.

1 participant