Skip to content

Flaky on windows-latest: OAuth metadata fetch times out in in-memory tests (same class as #1701, not covered by #1702) #1806

Description

@AkbarDizaji

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_WithInvalidClientMetadataDocument
  • OAuth.DcrFailureTests.DcrRejection_PropagatesToConsumer_WithStatusBodyAndSentParameters
  • ClientConformanceTests.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:

  1. a9f02522 - windows-latest, Debug - job - auth/offline-access-scope
  2. e07f4999 - 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions