From 9112030a3cb101a0de9a080ec6bac229ee07cf1c Mon Sep 17 00:00:00 2001 From: Brennan <brecon@microsoft.com> Date: Tue, 17 Mar 2020 16:31:24 -0700 Subject: [PATCH] Quarantine some tests (#19932) --- .../RevalidatingServerAuthenticationStateProvider.cs | 8 +++++--- .../test/HealthCheckPublisherHostedServiceTest.cs | 7 ++++--- src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs | 1 + .../test/FunctionalTests/UnixDomainSocketsTests.cs | 1 - .../Http2/Http2ConnectionTests.cs | 1 + src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs | 9 +++++---- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs b/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs index dc7d28d5026..ef4eae3630b 100644 --- a/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs +++ b/src/Components/Server/test/Circuits/RevalidatingServerAuthenticationStateProvider.cs @@ -9,6 +9,7 @@ using System.Threading; 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 @@ namespace Microsoft.AspNetCore.Components } [Fact] - public async Task IfValidateAuthenticationStateAsyncReturnsUnrelatedCancelledTask_TreatAsFailure() + [QuarantinedTest] + public async Task IfValidateAuthenticationStateAsyncReturnsUnrelatedCanceledTask_TreatAsFailure() { // Arrange var validationTcs = new TaskCompletionSource<bool>(); @@ -200,11 +202,11 @@ namespace Microsoft.AspNetCore.Components 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/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs b/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs index 099944a4733..17a5562a125 100644 --- a/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs +++ b/src/HealthChecks/HealthChecks/test/HealthCheckPublisherHostedServiceTest.cs @@ -129,7 +129,7 @@ namespace Microsoft.Extensions.Diagnostics.HealthChecks }; var service = CreateService(publishers); - + try { await service.StartAsync(); @@ -214,7 +214,7 @@ namespace Microsoft.Extensions.Diagnostics.HealthChecks 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 @@ namespace Microsoft.Extensions.Diagnostics.HealthChecks } [Fact] + [QuarantinedTest] public async Task RunAsync_PublishersCanTimeout() { // Arrange @@ -440,7 +441,7 @@ namespace Microsoft.Extensions.Diagnostics.HealthChecks } private HealthCheckPublisherHostedService CreateService( - IHealthCheckPublisher[] publishers, + IHealthCheckPublisher[] publishers, Action<HealthCheckPublisherOptions> configure = null, TestSink sink = null) { diff --git a/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs b/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs index 78e3645a248..3ddffe5bd34 100644 --- a/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs +++ b/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs @@ -887,6 +887,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers } [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 dc247c65437..a6a49d8b3bd 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs @@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests #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 f29cc35df59..7e8b5a41be5 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 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [Theory] [InlineData(true)] [InlineData(false)] + [QuarantinedTest] public async Task CONTINUATION_Received_WithTrailers_Available(bool sendData) { await InitializeConnectionAsync(_readTrailersApplication); diff --git a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs index c16a89197f7..48f6774b2bb 100644 --- a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs +++ b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs @@ -197,17 +197,18 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [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()); } -- GitLab