From 840a27ef7d5c3f18055ec79ea25bc86275d3d894 Mon Sep 17 00:00:00 2001 From: ManickaP Date: Tue, 17 Feb 2026 17:42:08 +0100 Subject: [PATCH 1/3] Re-enable PostAsync_Cancel_CancellationTokenPassedToContent test Remove the ActiveIssue attribute disabling this outerloop test. The test was disabled in January 2021 due to sporadic 60-second timeouts in CI. The HTTP/2 implementation has been significantly rewritten since then, and the underlying race conditions are likely resolved. Fixes https://github.com/dotnet/runtime/issues/41531 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs index b0a274ad787fcf..6905cbc9dc0812 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs @@ -520,7 +520,6 @@ public static IEnumerable PostAsync_Cancel_CancellationTokenPassedToCo } #if !NETFRAMEWORK - [ActiveIssue("https://github.com/dotnet/runtime/issues/41531")] [OuterLoop("Uses Task.Delay")] [Theory] [MemberData(nameof(PostAsync_Cancel_CancellationTokenPassedToContent_MemberData))] From f71fb17639524fba8f41cbdbf04e4b1ed551723a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marie=20P=C3=ADchov=C3=A1?= <11718369+ManickaP@users.noreply.github.com> Date: Thu, 19 Feb 2026 15:39:03 +0100 Subject: [PATCH 2/3] Update src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs index 6905cbc9dc0812..ddaa9058ba04b0 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs @@ -520,7 +520,6 @@ public static IEnumerable PostAsync_Cancel_CancellationTokenPassedToCo } #if !NETFRAMEWORK - [OuterLoop("Uses Task.Delay")] [Theory] [MemberData(nameof(PostAsync_Cancel_CancellationTokenPassedToContent_MemberData))] public async Task PostAsync_Cancel_CancellationTokenPassedToContent(HttpContent content, CancellationTokenSource cancellationTokenSource) From b8eaa01755e2f3d913c1c6bc060efe5760234935 Mon Sep 17 00:00:00 2001 From: ManickaP Date: Thu, 19 Feb 2026 16:34:05 +0100 Subject: [PATCH 3/3] Add explicit timeout to PostAsync_Cancel_CancellationTokenPassedToContent Add WaitAsync(TestHelper.PassingTestTimeout) to the CreateClientAndServerAsync call to fail fast with a TimeoutException instead of hanging indefinitely if cancellation propagation regresses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs index ddaa9058ba04b0..6b95f52046f217 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs @@ -556,7 +556,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync( await server.HandleRequestAsync(content: "Hello World"); } catch (Exception) { } - }); + }).WaitAsync(TestHelper.PassingTestTimeout); } #endif