Flaky on windows-latest: OAuth metadata fetch times out in in-memory tests (same class as #1701, not covered by #1702)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- authentication, ci-cd, testing
Research direction
Read GetAuthServerMetadataAsync and compare its timeout handling with the server/discover probe timeout added by #1702. Reproduce the failure by rerunning the windows-latest Build and Test leg, starting with the three named tests. Done means metadata-fetch timeouts surface as timeout errors rather than assertion failures, and the affected tests are deterministic.
Written by the indexing model from the issue text.
Description
Describe the bug
Several OAuth tests occasionally fail on the windows-latest legs of Build and Test.
If that occurs, the GetAuthServerMetadataAsync method gets a TaskCancelledException
during a slow TLS handshake using the in-memory duplex pipe, ClientOAuthProvider wraps
that into the "Failed to find .well-known/..." message, and assertion expectations
about that message fail on the injected text – that is, the error manifests itself as
a confusing assertion failure instead of a timeout.
It appears to be similar to #1701 from the OAuth side of things. #1702 increased
the server/discover probe timeout in the in-memory tests, but the OAuth metadata
path has a similar timeout which was not added and is still failing after that merge.
Tests affected so far:
OAuth.AuthTests.CannotAuthenticate_WithInvalidClientMetadataDocumentOAuth.DcrFailureTests.DcrRejection_PropagatesToConsumer_WithStatusBodyAndSentParametersClientConformanceTests.RunConformanceTest(scenario: "auth/offline-access-scope")
To Reproduce
Intermittent, not deterministic reproduction possible. It is reproduced by running Build and Tests
of windows-latest leg multiple times.
The following two incidents are on August 9, right after merging PR #1702, for two consecutive
commits of the same branch which are identical but different in comments and tests:
a9f02522- windows-latest, Debug - job -auth/offline-access-scopee07f4999- windows-latest, Release - [job](https://
Expected behavior
Tests need to be deterministic. In case the timeout happens during fetching of the metadata, the issue should be thrown as a timeout and not as an assertion failure on an error message that’s not related to it at all.
Logs
From the e07f4999 Release run
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/csharp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/csharp-sdk#678 · 1 comment ·
-
enhancement needs confirmation P3 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/csharp-sdk#515 · 6 comments · 3 reactions ·
All issues in modelcontextprotocol/csharp-sdk
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·