From 28992d53702d103d3a0fb644cfeeb7ff7e8642d6 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 17 Mar 2020 12:42:40 -0700 Subject: [PATCH 1/2] Quarantine some tests --- .../RevalidatingServerAuthenticationStateProvider.cs | 8 +++++--- src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs b/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs index dc7d28d50269..ef4eae3630b6 100644 --- a/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs +++ b/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Server; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging.Abstractions; using Xunit; @@ -184,7 +185,8 @@ public async Task SuppliesCancellationTokenThatSignalsWhenRevalidationLoopIsBein } [Fact] - public async Task IfValidateAuthenticationStateAsyncReturnsUnrelatedCancelledTask_TreatAsFailure() + [QuarantinedTest] + public async Task IfValidateAuthenticationStateAsyncReturnsUnrelatedCanceledTask_TreatAsFailure() { // Arrange var validationTcs = new TaskCompletionSource(); @@ -200,11 +202,11 @@ public async Task IfValidateAuthenticationStateAsyncReturnsUnrelatedCancelledTas var firstRevalidationCall = provider.RevalidationCallLog.Single(); Assert.Equal(0, authenticationStateChangedCount); - // Act: ValidateAuthenticationStateAsync returns cancelled task, but the cancellation + // Act: ValidateAuthenticationStateAsync returns canceled task, but the cancellation // is unrelated to the CT we supplied validationTcs.TrySetCanceled(new CancellationTokenSource().Token); - // Assert: Since we didn't ask for that operation to be cancelled, this is treated as + // Assert: Since we didn't ask for that operation to be canceled, this is treated as // a failure to validate, so we force a logout Assert.Equal(1, authenticationStateChangedCount); var newAuthState = await provider.GetAuthenticationStateAsync(); diff --git a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs index c16a89197f79..48f6774b2bb0 100644 --- a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs +++ b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs @@ -197,17 +197,18 @@ public void Remove_Non_Existing_Secret() } [Fact] + [QuarantinedTest] public void Remove_Is_Case_Insensitive() { var projectPath = _fixture.GetTempSecretProject(); var secretManager = CreateProgram(); - secretManager.RunInternal("set", "SeCreT1", "value", "-p", projectPath); - secretManager.RunInternal("list", "-p", projectPath); + secretManager.RunInternal("set", "SeCreT1", "value", "-p", projectPath, "--verbose"); + secretManager.RunInternal("list", "-p", projectPath, "--verbose"); Assert.Contains("SeCreT1 = value", _console.GetOutput()); - secretManager.RunInternal("remove", "secret1", "-p", projectPath); + secretManager.RunInternal("remove", "secret1", "-p", projectPath, "--verbose"); _console.ClearOutput(); - secretManager.RunInternal("list", "-p", projectPath); + secretManager.RunInternal("list", "-p", projectPath, "--verbose"); Assert.Contains(Resources.Error_No_Secrets_Found, _console.GetOutput()); } From a7ffda1d1e45639f65d37ac04ba02d9993de8725 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 17 Mar 2020 15:02:17 -0700 Subject: [PATCH 2/2] fb --- .../test/HealthCheckPublisherHostedServiceTest.cs | 7 ++++--- src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs | 1 + .../Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs | 1 - .../InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs | 1 + .../Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs | 1 - 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs b/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs index 099944a47330..17a5562a125f 100644 --- a/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs +++ b/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs @@ -129,7 +129,7 @@ public async Task StopAsync_CancelsExecution() }; var service = CreateService(publishers); - + try { await service.StartAsync(); @@ -214,7 +214,7 @@ public async Task RunAsync_WaitsForCompletion_Single() entry => { Assert.Contains(entry.EventId, new[] { DefaultHealthCheckService.EventIds.HealthCheckBegin, DefaultHealthCheckService.EventIds.HealthCheckEnd }); }, entry => { Assert.Contains(entry.EventId, new[] { DefaultHealthCheckService.EventIds.HealthCheckBegin, DefaultHealthCheckService.EventIds.HealthCheckEnd }); }, entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingEnd, entry.EventId); }, + entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingEnd, entry.EventId); }, entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherBegin, entry.EventId); }, entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherEnd, entry.EventId); }, entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingEnd, entry.EventId); }); @@ -274,6 +274,7 @@ public async Task RunAsync_WaitsForCompletion_Multiple() } [Fact] + [QuarantinedTest] public async Task RunAsync_PublishersCanTimeout() { // Arrange @@ -440,7 +441,7 @@ public async Task RunAsync_HandlesExceptions_Multiple() } private HealthCheckPublisherHostedService CreateService( - IHealthCheckPublisher[] publishers, + IHealthCheckPublisher[] publishers, Action configure = null, TestSink sink = null) { diff --git a/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs b/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs index 78e3645a248b..3ddffe5bd34e 100644 --- a/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs +++ b/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs @@ -887,6 +887,7 @@ public async Task ProcessAsync_ThrowsExceptionForAwaiters_IfExecutorEncountersAn } [Fact] + [QuarantinedTest] public async Task ProcessAsync_AwaitersUseTheResultOfExecutor() { // Arrange diff --git a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs index dc247c654379..a6a49d8b3bdd 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs @@ -30,7 +30,6 @@ public class UnixDomainSocketsTest : TestApplicationErrorLoggerLoggedTest #endif [ConditionalFact] [CollectDump] - [QuarantinedTest] public async Task TestUnixDomainSocket() { var path = Path.GetTempFileName(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index f29cc35df596..7e8b5a41be5a 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -3660,6 +3660,7 @@ await ExpectAsync(Http2FrameType.HEADERS, [Theory] [InlineData(true)] [InlineData(false)] + [QuarantinedTest] public async Task CONTINUATION_Received_WithTrailers_Available(bool sendData) { await InitializeConnectionAsync(_readTrailersApplication); diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs index 862adb0bb487..eb7a95a2281d 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs @@ -21,7 +21,6 @@ public class H2SpecTests : LoggedTest { [ConditionalTheory] [MemberData(nameof(H2SpecTestCases))] - [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2225")] public async Task RunIndividualTestCase(H2SpecTestCase testCase) { var hostBuilder = new WebHostBuilder()