test(oauth): extend metadata discovery probe timeout - #1833
Open
jstar0 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Rechecked current head All reported hosted checks are green, including CodeQL, C# analysis, and the Ubuntu/macOS/Windows Debug and Release build jobs. The focused OAuth verification remains green locally (98 tests), and the change is limited to the test/conformance discovery-probe timeout path; production client defaults and OAuth behavior are unchanged. This is ready for maintainer review. |
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
Fixes #1806 by keeping OAuth metadata discovery from being cancelled by the five-second
server/discoverprobe timeout in slow in-memory CI environments.When the protected MCP endpoint returns
401, metadata discovery runs under the same probe cancellation token. A slow TLS/duplex-pipe handshake can therefore cancelGetAuthServerMetadataAsyncbefore it finishes, producing a misleading metadata-discovery assertion failure.Changes
OAuthTestBase.CreateMcpClientAsynchelper that uses the shared 60-second test budget forDiscoverProbeTimeout.Verification
dotnet test tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj --framework net10.0 --configuration Release --no-restore --filter 'FullyQualifiedName~CannotAuthenticate_WithInvalidClientMetadataDocument|FullyQualifiedName~DcrRejection_PropagatesToConsumer_WithStatusBodyAndSentParameters'— 3 passed\n-dotnet test tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj --framework net10.0 --configuration Release --no-restore --filter 'FullyQualifiedName~ModelContextProtocol.AspNetCore.Tests.OAuth'— 98 passed\n-git diff --check— passed\n\nThe net8.0/net9.0 variants were not runnable on this workstation because those runtimes are not installed; they remain covered by the repository CI matrix.