Repository navigation
Conversation
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.
5 tasks done
This branch has not been deployed
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.
Summary
This is a test-only follow-up to #1943. #1943 disabled the separate
server/discoverprobe timeout for stdiotest_serverclients only when a test passes no client options.Sampling_Stdiopasses options for its sampling handler without pinning a protocol version, so itstest_servercase still used the 5-second probe and failed the same way on Windows:ClientIntegrationTestFixture.CreateClientAsyncnow applies Fix flaky CI tests with test-only discovery timeout configuration #1943's timeouts to options a test passes fortest_servertoo, unless the test changed them from their defaults. Fix flaky CI tests with test-only discovery timeout configuration #1943 kept explicitly supplied options on purpose; this still keeps any timeout a test sets and only fills in defaults. (InitializationTimeoutis set as in Fix flaky CI tests with test-only discovery timeout configuration #1943; it equals the default today.)ClientServerTestBase.CreateMcpClientForServerdoes.everythingserver defaults, other stdio clients and the dedicated discovery/fallback tests are unchanged. SDK behavior is unchanged; this does not fix the underlying fallback race.CI evidence
ClientIntegrationTests.Sampling_Stdio(clientId: "test_server")on .NET 8, after Fix flaky CI tests with test-only discovery timeout configuration #1943 was merged.Validation
server/discoveranswer for 7 seconds, a local-only change that is not in this PR. Onmain,ClientIntegrationTestson .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).ClientIntegrationTestsandJuly2026ProtocolFallbackTests(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.