Skip to content

Apply the test-only discovery timeout to test_server clients that pass options - #1950

Open
girishkvs wants to merge 1 commit into
modelcontextprotocol:mainfrom
girishkvs:test_server_discover_timeout
Open

girishkvs wants to merge 1 commit into
modelcontextprotocol:mainfrom
girishkvs:test_server_discover_timeout

Conversation

@girishkvs

Copy link
Copy Markdown

Summary

This is a test-only follow-up to #1943. #1943 disabled the separate server/discover probe timeout for stdio test_server clients only when a test passes no client options. Sampling_Stdio passes options for its sampling handler without pinning a protocol version, so its test_server case still used the 5-second probe and failed the same way on Windows:

McpProtocolException: Request failed (remote): Method 'initialize' is not available on protocol version '2026-07-28'.

CI evidence

Validation

  • Reproduced by holding the TestServer's server/discover answer for 7 seconds, a local-only change that is not in this PR. On main, ClientIntegrationTests on .NET 8 had one failure, Sampling_Stdio(clientId: "test_server"), with the CI message (58 passed, 2 skipped). With this change, all passed (59 passed, 2 skipped).
  • Without the delay, ClientIntegrationTests and July2026ProtocolFallbackTests (91 tests): 20 runs on .NET 8 and one run each on .NET 10 and .NET Framework 4.7.2, with zero failures. Each run had 89 passed and the 2 OpenAI-key skips.

modelcontextprotocol#1943 removed the separate server/discover probe timeout for stdio
test_server clients only when a test passes no options. Sampling_Stdio
passes its own options without pinning a protocol version, so it still used
the 5-second probe and could fall back to initialize while the discover
answer was on its way; the server then rejects initialize. Apply the same
timeouts to options a test passes, unless the test changed them.
@girishkvs girishkvs mentioned this pull request Oct 22, 2026
5 tasks done

This branch has not been deployed

No deployments
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