From b183055db6605832c22282fda5bcd87425dfd9d7 Mon Sep 17 00:00:00 2001 From: Alexander Nikolaev Date: Thu, 24 Jun 2021 15:40:49 +0200 Subject: [PATCH 1/6] Trying to enable 2 disabled multiple HTTP/2 connection tests --- .../tests/FunctionalTests/SocketsHttpHandlerTest.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 0ac38b257277fa..17579c9220bccc 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -2059,7 +2059,6 @@ public sealed class SocketsHttpHandlerTest_Http2 : HttpClientHandlerTest_Http2 public SocketsHttpHandlerTest_Http2(ITestOutputHelper output) : base(output) { } [ConditionalFact(nameof(SupportsAlpn))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41078")] public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled() { const int MaxConcurrentStreams = 2; @@ -2100,7 +2099,6 @@ public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_Con } [ConditionalFact(nameof(SupportsAlpn))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/45204")] public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_RemaningRequestsAreHandledByNewConnection() { const int MaxConcurrentStreams = 2; From abb47c9d845ca192cfe7766356deebad59a102b0 Mon Sep 17 00:00:00 2001 From: Alexander Nikolaev Date: Fri, 25 Jun 2021 11:53:31 +0200 Subject: [PATCH 2/6] Run tests in a loop --- .../FunctionalTests/SocketsHttpHandlerTest.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 17579c9220bccc..8baea6084542bb 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -2058,9 +2058,11 @@ public sealed class SocketsHttpHandlerTest_Http2 : HttpClientHandlerTest_Http2 { public SocketsHttpHandlerTest_Http2(ITestOutputHelper output) : base(output) { } - [ConditionalFact(nameof(SupportsAlpn))] - public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled() + [ConditionalTheory(nameof(SupportsAlpn))] + [MemberData(nameof(LongRunSequence))] + public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled(int a) { + Assert.True(a > -1); const int MaxConcurrentStreams = 2; using Http2LoopbackServer server = Http2LoopbackServer.CreateServer(); using SocketsHttpHandler handler = CreateHandler(); @@ -2098,9 +2100,11 @@ public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_Con } } - [ConditionalFact(nameof(SupportsAlpn))] - public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_RemaningRequestsAreHandledByNewConnection() + [ConditionalTheory(nameof(SupportsAlpn))] + [MemberData(nameof(LongRunSequence))] + public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_RemaningRequestsAreHandledByNewConnection(int a) { + Assert.True(a > -1); const int MaxConcurrentStreams = 2; using Http2LoopbackServer server = Http2LoopbackServer.CreateServer(); using SocketsHttpHandler handler = CreateHandler(); @@ -2133,6 +2137,14 @@ public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlo } } + public static IEnumerable LongRunSequence() + { + for (var i = 0; i < 30000; i++) + { + yield return new object[] { i }; + } + } + [ConditionalFact(nameof(SupportsAlpn))] public async Task Http2_MultipleConnectionsEnabled_OpenAndCloseMultipleConnections_Success() { From 10ae4c7f95e3a451ec0d7384d6a5e8e5965115be Mon Sep 17 00:00:00 2001 From: Alexander Nikolaev Date: Fri, 25 Jun 2021 16:26:24 +0200 Subject: [PATCH 3/6] Reduce iteration count --- .../tests/FunctionalTests/SocketsHttpHandlerTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 8baea6084542bb..7892897d04a449 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -2139,7 +2139,7 @@ public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlo public static IEnumerable LongRunSequence() { - for (var i = 0; i < 30000; i++) + for (var i = 0; i < 5000; i++) { yield return new object[] { i }; } From c980581f5b7610d86de9cf908493c0967e698b15 Mon Sep 17 00:00:00 2001 From: Alexander Nikolaev <55398552+alnikola@users.noreply.github.com> Date: Fri, 25 Jun 2021 18:15:52 +0200 Subject: [PATCH 4/6] Reduce test iterations to 1000 --- .../tests/FunctionalTests/SocketsHttpHandlerTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 7892897d04a449..bd14659850fd39 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -2139,7 +2139,7 @@ public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlo public static IEnumerable LongRunSequence() { - for (var i = 0; i < 5000; i++) + for (var i = 0; i < 1000; i++) { yield return new object[] { i }; } From ecc3b2e2ad808db2fe0473e02d9572d4205b90f8 Mon Sep 17 00:00:00 2001 From: Alexander Nikolaev <55398552+alnikola@users.noreply.github.com> Date: Mon, 28 Jun 2021 13:33:29 +0200 Subject: [PATCH 5/6] Disable Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled --- .../tests/FunctionalTests/SocketsHttpHandlerTest.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index bd14659850fd39..0a49feba3e5522 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -2058,11 +2058,10 @@ public sealed class SocketsHttpHandlerTest_Http2 : HttpClientHandlerTest_Http2 { public SocketsHttpHandlerTest_Http2(ITestOutputHelper output) : base(output) { } - [ConditionalTheory(nameof(SupportsAlpn))] - [MemberData(nameof(LongRunSequence))] - public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled(int a) + [ConditionalFact(nameof(SupportsAlpn))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41078")] + public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_ConcurrentRequestsSuccessfullyHandled() { - Assert.True(a > -1); const int MaxConcurrentStreams = 2; using Http2LoopbackServer server = Http2LoopbackServer.CreateServer(); using SocketsHttpHandler handler = CreateHandler(); From 43d6706c29a4e684d99adf7d3d84214c6b8c2e36 Mon Sep 17 00:00:00 2001 From: Alexander Nikolaev <55398552+alnikola@users.noreply.github.com> Date: Mon, 28 Jun 2021 18:31:45 +0200 Subject: [PATCH 6/6] Update SocketsHttpHandlerTest.cs --- .../FunctionalTests/SocketsHttpHandlerTest.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 0a49feba3e5522..5488adc2a4dc14 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -2099,11 +2099,9 @@ public async Task Http2_MultipleConnectionsEnabled_ConnectionLimitNotReached_Con } } - [ConditionalTheory(nameof(SupportsAlpn))] - [MemberData(nameof(LongRunSequence))] - public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_RemaningRequestsAreHandledByNewConnection(int a) + [ConditionalFact(nameof(SupportsAlpn))] + public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_RemaningRequestsAreHandledByNewConnection() { - Assert.True(a > -1); const int MaxConcurrentStreams = 2; using Http2LoopbackServer server = Http2LoopbackServer.CreateServer(); using SocketsHttpHandler handler = CreateHandler(); @@ -2136,14 +2134,6 @@ public async Task Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlo } } - public static IEnumerable LongRunSequence() - { - for (var i = 0; i < 1000; i++) - { - yield return new object[] { i }; - } - } - [ConditionalFact(nameof(SupportsAlpn))] public async Task Http2_MultipleConnectionsEnabled_OpenAndCloseMultipleConnections_Success() {