From a240ccfd322ce958e8a56dd07e179cf07662ea26 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 7 Aug 2020 13:20:29 -0700 Subject: [PATCH 1/8] Update test runner to 2.4.3 Using rc1 SDK requires an update to the test runner. In the absence of this change dotnet test silently fails. This means none of our helix tests are currently executing. --- eng/Versions.props | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/Versions.props b/eng/Versions.props index c8f31f55de13..2f7ac061d856 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -279,6 +279,7 @@ $(XunitVersion) $(XunitVersion) $(XunitVersion) + 2.4.3 1.0.19249.1 From 3f3a4e4b1bdd6a3c52b849dffdf5015ebe9b9827 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 7 Aug 2020 16:04:26 -0700 Subject: [PATCH 2/8] Skip failing test --- src/ProjectTemplates/test/WorkerTemplateTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ProjectTemplates/test/WorkerTemplateTest.cs b/src/ProjectTemplates/test/WorkerTemplateTest.cs index 0a3bca6568ce..d7e471458510 100644 --- a/src/ProjectTemplates/test/WorkerTemplateTest.cs +++ b/src/ProjectTemplates/test/WorkerTemplateTest.cs @@ -21,7 +21,8 @@ public WorkerTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputHelpe public ProjectFactoryFixture ProjectFactory { get; } public ITestOutputHelper Output { get; } - [Fact] + [ConditionalFact] + [OSSkipCondition(OperatingSystems.Linux, SkipReason = "https://github.com/dotnet/sdk/issues/12831")] public async Task WorkerTemplateAsync() { Project = await ProjectFactory.GetOrCreateProject("worker", Output); From 8acff150ffeb19435c5b65ce0e6ef78ca0e3a76f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 7 Aug 2020 17:12:03 -0700 Subject: [PATCH 3/8] React to System.IO.Pipelines changes --- eng/SharedFramework.External.props | 1 - src/Framework/test/TestData.cs | 2 -- src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj | 1 - .../Http.Features/src/Microsoft.AspNetCore.Http.Features.csproj | 2 +- .../WebUtilities/src/Microsoft.AspNetCore.WebUtilities.csproj | 1 - .../src/Microsoft.AspNetCore.Connections.Abstractions.csproj | 1 - src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj | 1 - .../src/Microsoft.AspNetCore.Server.IISIntegration.csproj | 1 - .../test/Shared.Tests/Microsoft.AspNetCore.Shared.Tests.csproj | 1 - 9 files changed, 1 insertion(+), 10 deletions(-) diff --git a/eng/SharedFramework.External.props b/eng/SharedFramework.External.props index a43f82e80353..d9914be2e486 100644 --- a/eng/SharedFramework.External.props +++ b/eng/SharedFramework.External.props @@ -40,7 +40,6 @@ - + true true diff --git a/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj b/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj index 70f9a694695e..ea0e2ec78ef8 100644 --- a/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj @@ -5,6 +5,8 @@ IISNewHandler.FunctionalTests True true + + true true diff --git a/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj b/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj index e70b5c17d427..1edf4ae9b896 100644 --- a/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj @@ -5,6 +5,8 @@ IISNewShim.FunctionalTests True true + + true true diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj b/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj index 1b54904dee94..d923a83f3913 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj @@ -5,6 +5,7 @@ $(DefaultNetCoreTargetFramework) true + true From 29553a55dbe7a44600720a4c52f59bf2e881fe92 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 10 Aug 2020 09:10:21 -0700 Subject: [PATCH 5/8] Trying to fix tests --- src/Servers/IIS/IIS/src/Core/IISHttpContextOfT.cs | 2 +- .../IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Servers/IIS/IIS/src/Core/IISHttpContextOfT.cs b/src/Servers/IIS/IIS/src/Core/IISHttpContextOfT.cs index 8731cfa2de3f..390770b49a6d 100644 --- a/src/Servers/IIS/IIS/src/Core/IISHttpContextOfT.cs +++ b/src/Servers/IIS/IIS/src/Core/IISHttpContextOfT.cs @@ -59,7 +59,7 @@ public override async Task ProcessRequestAsync() // Dispose } - if (!success && HasResponseStarted) + if (!success && HasResponseStarted && NativeMethods.HttpSupportTrailer(_pInProcessHandler)) { // HTTP/2 INTERNAL_ERROR = 0x2 https://tools.ietf.org/html/rfc7540#section-7 // Otherwise the default is Cancel = 0x8. diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs index 8bcca34d262c..9bdf28aca273 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs @@ -50,6 +50,7 @@ public ResetTests(PublishedSitesFixture fixture) : base(fixture) }; [ConditionalFact] + [RequiresNewHandler] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10, SkipReason = "Http2 requires Win10")] public async Task AppException_BeforeResponseHeaders_500() { From 4abdd3870c5b248e408a372cb0279ce05b242a5f Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 10 Aug 2020 09:12:03 -0700 Subject: [PATCH 6/8] nit --- .../Inprocess/ResetTests.cs | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs index 9bdf28aca273..14ea47481bbd 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs @@ -24,6 +24,8 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [Collection(PublishedSitesCollection.Name)] public class ResetTests : IISFunctionalTestBase { + private const string WindowsVersionForTrailers = "10.0.20180"; + public ResetTests(PublishedSitesFixture fixture) : base(fixture) { } @@ -88,6 +90,7 @@ await h2Connection.ReceiveHeadersAsync(1, decodedHeaders => } [ConditionalFact] + [RequiresNewHandler] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10, SkipReason = "Http2 requires Win10")] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H1, SkipReason = "This is last version without custom Reset support")] public async Task AppException_AfterHeaders_PriorOSVersions_ResetCancel() @@ -118,7 +121,8 @@ await h2Connection.ReceiveHeadersAsync(1, decodedHeaders => } [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Custom Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Custom Reset support was added in Win10_20H2.")] public async Task AppException_AfterHeaders_ResetInternalError() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -155,6 +159,7 @@ await h2Connection.ReceiveHeadersAsync(1, decodedHeaders => } [ConditionalFact] + [RequiresNewHandler] public async Task Reset_Http1_NotSupported() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -169,6 +174,7 @@ public async Task Reset_Http1_NotSupported() } [ConditionalFact] + [RequiresNewHandler] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10, SkipReason = "Http2 requires Win10")] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H1, SkipReason = "This is last version without Reset support")] public async Task Reset_PriorOSVersions_NotSupported() @@ -185,7 +191,8 @@ public async Task Reset_PriorOSVersions_NotSupported() } [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")] public async Task Reset_BeforeResponse_Resets() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -214,7 +221,8 @@ public async Task Reset_BeforeResponse_Resets() } [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")] public async Task Reset_BeforeResponse_Zero_Resets() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -243,7 +251,8 @@ public async Task Reset_BeforeResponse_Zero_Resets() } [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")] public async Task Reset_AfterResponseHeaders_Resets() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -280,7 +289,8 @@ await h2Connection.ReceiveHeadersAsync(1, decodedHeaders => } [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")] public async Task Reset_DuringResponseBody_Resets() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -319,7 +329,8 @@ public async Task Reset_DuringResponseBody_Resets() [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")] public async Task Reset_BeforeRequestBody_Resets() { var deploymentParameters = GetHttpsDeploymentParameters(); @@ -346,7 +357,8 @@ public async Task Reset_BeforeRequestBody_Resets() } [ConditionalFact] - [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Reset support was added in Win10_20H2.")] + [RequiresNewHandler] + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")] public async Task Reset_DuringRequestBody_Resets() { var deploymentParameters = GetHttpsDeploymentParameters(); From 5268462298b2fda99f77b8b06b0819acab6367c5 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 10 Aug 2020 09:18:32 -0700 Subject: [PATCH 7/8] unskip --- .../IIS/IIS/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj | 2 -- .../IIS.NewHandler.FunctionalTests.csproj | 2 -- .../IIS.NewShim.FunctionalTests.csproj | 2 -- src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj | 1 - 4 files changed, 7 deletions(-) diff --git a/src/Servers/IIS/IIS/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj b/src/Servers/IIS/IIS/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj index aab2ddf06d0b..b03eeccaffa0 100644 --- a/src/Servers/IIS/IIS/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj @@ -5,8 +5,6 @@ IIS.FunctionalTests True true - - true true diff --git a/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj b/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj index ea0e2ec78ef8..70f9a694695e 100644 --- a/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/IIS.NewHandler.FunctionalTests.csproj @@ -5,8 +5,6 @@ IISNewHandler.FunctionalTests True true - - true true diff --git a/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj b/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj index 1edf4ae9b896..e70b5c17d427 100644 --- a/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj @@ -5,8 +5,6 @@ IISNewShim.FunctionalTests True true - - true true diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj b/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj index d923a83f3913..1b54904dee94 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj +++ b/src/Servers/IIS/IIS/test/IIS.Tests/IIS.Tests.csproj @@ -5,7 +5,6 @@ $(DefaultNetCoreTargetFramework) true - true From adac08d1302c36fd95a7677dbca2bd4b0f5c5d29 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 10 Aug 2020 10:40:03 -0700 Subject: [PATCH 8/8] nits --- .../Inprocess/ResetTests.cs | 35 ++----------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs index 14ea47481bbd..bb6f29355b06 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ResetTests.cs @@ -89,37 +89,6 @@ await h2Connection.ReceiveHeadersAsync(1, decodedHeaders => .Build().RunAsync(); } - [ConditionalFact] - [RequiresNewHandler] - [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10, SkipReason = "Http2 requires Win10")] - [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10_20H1, SkipReason = "This is last version without custom Reset support")] - public async Task AppException_AfterHeaders_PriorOSVersions_ResetCancel() - { - var deploymentParameters = GetHttpsDeploymentParameters(); - var deploymentResult = await DeployAsync(deploymentParameters); - - await new HostBuilder() - .UseHttp2Cat(deploymentResult.ApplicationBaseUri + "AppException_AfterHeaders_PriorOSVersions_ResetCancel", async h2Connection => - { - await h2Connection.InitializeConnectionAsync(); - - h2Connection.Logger.LogInformation("Initialized http2 connection. Starting stream 1."); - - await h2Connection.StartStreamAsync(1, GetHeaders("/AppException_AfterHeaders_PriorOSVersions_ResetCancel"), endStream: true); - - await h2Connection.ReceiveHeadersAsync(1, decodedHeaders => - { - Assert.Equal("200", decodedHeaders[HeaderNames.Status]); - }); - - var resetFrame = await h2Connection.ReceiveFrameAsync(); - Http2Utilities.VerifyResetFrame(resetFrame, expectedStreamId: 1, Http2ErrorCode.CANCEL); - - h2Connection.Logger.LogInformation("Connection stopped."); - }) - .Build().RunAsync(); - } - [ConditionalFact] [RequiresNewHandler] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Custom Reset support was added in Win10_20H2.")] @@ -186,7 +155,7 @@ public async Task Reset_PriorOSVersions_NotSupported() handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; using HttpClient client = new HttpClient(handler); client.DefaultRequestVersion = HttpVersion.Version20; - var response = await client.GetStringAsync(deploymentResult.ApplicationBaseUri); + var response = await client.GetStringAsync(deploymentResult.ApplicationBaseUri + "Reset_PriorOSVersions_NotSupported"); Assert.Equal("Hello World", response); } @@ -327,7 +296,7 @@ public async Task Reset_DuringResponseBody_Resets() .Build().RunAsync(); } - + [ConditionalFact] [RequiresNewHandler] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers, SkipReason = "Reset support was added in Win10_20H2.")]