Repository navigation
test: drive the MCP heartbeat test with one controlled tick - #380
Merged
Merged
Conversation
The test's 20 ms heartbeat was also a 20 ms liveness deadline, so one pause while a ping was unanswered ended the socket before its only providers.updated arrived, and the test waited out its failure guard. One mocked tick can't end the socket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Removes a timing dependency from one required test. No production code changes.
an open page hears an MCP server removed outside the card, from the heartbeatfailed onTest (macos-latest, Node 22)in release run 42325109131, which cancelled the release of #379.Cause: the test set
heartbeatMs: 20. The heartbeat is also the socket's liveness check, so one pause in the test process while a ping was unanswered could terminate the socket before its onlyproviders.updatedarrived. The test then waited out its 10 s guard. A throwaway reproduction with an injected pause gave this result in 5 of 5 runs. The CI log doesn't record the close, so this shows the mechanism produces this failure, not that it is what happened in that run.Fix: mock
setIntervaland fire one controlled tick after the external change. One tick can't terminate the socket, because the liveness check takes two. The real refresh and WebSocket broadcast still run, and the 10 s guard is unchanged.Checks
Run locally at
a87ef8d, with temporary edits that were then restored:providers.updatedreportingoff.On Windows,
tests/mcp-connect.test.mjspasses 18 of 18,npm testhas 1203 passed, 0 failed and 75 skipped, and all 12 browser tests andtests/release/plan.mjspass. The fixed test also passes on Node 22.🤖 Generated with Claude Code