Skip to content

Fix intermittent failures in CertificatesObserverTests#3686

Closed
RyAuld wants to merge 3 commits intomasterfrom
fix/certificate-observer-test-intermittent-failures
Closed

Fix intermittent failures in CertificatesObserverTests#3686
RyAuld wants to merge 3 commits intomasterfrom
fix/certificate-observer-test-intermittent-failures

Conversation

@RyAuld
Copy link
Contributor

@RyAuld RyAuld commented Jan 28, 2026

This PR fixes intermittent test failures in CertificatesObserverTests.ObserverSendsCorrectEvents.

Key fixes:

  • Fixed certificate validation logic using thumbprint-based comparison
  • Added robust certificate store verification with timing controls
  • Implemented unique certificate naming to prevent cross-framework interference

The test now passes consistently across all .NET frameworks (8.0, 9.0, 10.0).

- Fixed certificate validation logic in MockHttpMessageHandler to use thumbprint-based comparison instead of object reference equality
- Added robust certificate store verification with timing controls to handle asynchronous store operations
- Implemented unique certificate naming with GUID prefixes to prevent cross-framework test interference
- Resolved AADSTS700027 authentication errors and parallel test execution conflicts

The test now passes consistently across all target .NET frameworks (8.0, 9.0, 10.0) with reliable certificate handling.
@RyAuld RyAuld requested a review from a team as a code owner January 28, 2026 22:56
@RyAuld
Copy link
Contributor Author

RyAuld commented Jan 28, 2026

Closing this PR as it accidentally included unrelated changes from a lab migration branch. Created clean PR #3687 with only the certificate observer test fix.

@RyAuld RyAuld closed this Jan 28, 2026
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