From 090250fbd3583bfa797f83e1fa86f86e388d42e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Rozto=C4=8Dil?= Date: Wed, 3 Sep 2025 14:39:21 +0200 Subject: [PATCH] Fix SuppliesCancellationTokenThatSignalsWhenRevalidationLoopIsBeingDiscarded flake --- .../RevalidatingServerAuthenticationStateProviderTest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProviderTest.cs b/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProviderTest.cs index c734415ce0cc..483fc9f667d6 100644 --- a/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProviderTest.cs +++ b/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProviderTest.cs @@ -142,7 +142,6 @@ public async Task StopsRevalidatingAfterDisposal() } [Fact] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/60472")] public async Task SuppliesCancellationTokenThatSignalsWhenRevalidationLoopIsBeingDiscarded() { // Arrange @@ -174,9 +173,11 @@ public async Task SuppliesCancellationTokenThatSignalsWhenRevalidationLoopIsBein Assert.Equal("different user", (await provider.GetAuthenticationStateAsync()).User.Identity.Name); // Subsequent revalidation can complete successfully + // We are checking all new logs because the revalidation loop iteration + // may happen multiple times (this made the test flaky in the past) await provider.NextValidateAuthenticationStateAsyncCall; - Assert.Collection(provider.RevalidationCallLog.Skip(1), - call => Assert.Equal("different user", call.AuthenticationState.User.Identity.Name)); + Assert.All(provider.RevalidationCallLog.Skip(1), + call => Assert.Equal("different user", call.AuthenticationState.User.Identity.Name)); } [Fact]