dotnet / dotnet/runtime

Test Failure: CancelTest_HttpClient_Loopback.ConnectAsync_Cancel_ThrowsCancellationException -- TimeoutException variant (jitstress2 win-x64)

Open
#128,597 2 comments 0 reactions 0 assignees View on GitHub
area-System.Net blocking-clean-ci-optional JitStress
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

**Summary:**
CancelTest_HttpClient_Loopback.ConnectAsync_Cancel_ThrowsCancellationException(useSsl: False) on windows x64 under DOTNET_JitStress=2 fails with `System.TimeoutException : The operation has timed out.` from `TaskTimeoutExtensions.WhenAllOrAnyFailed`, called by LoopbackWebSocketServer.HttpRunner.RunAsync. Single test failure in libraries-jitstress build 1435045.

**Failed in (1):**
- [runtime-coreclr libraries-jitstress 20260526.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1435045)

**Console Log:** [Console Log](https://helix.dot.net/api/2019-06-17/jobs/55a22ae0-ab67-42d0-8769-ba2e99f9043d/workitems/System.Net.WebSockets.Client.Tests/console)
**Source:** [runtime-coreclr libraries-jitstress / net11.0-windows-Release-x64-jitstress2-Windows.10.Amd64.Open / System.Net.WebSockets.Client.Tests.CancelTest_HttpClient_Loopback.ConnectAsync_Cancel_ThrowsCancellationException](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1435045&view=ms.vss-test-web.build-test-results-tab)

**Failed tests:**
```
- net11.0-windows-Release-x64-jitstress2-Windows.10.Amd64.Open
- System.Net.WebSockets.Client.Tests.CancelTest_HttpClient_Loopback.ConnectAsync_Cancel_ThrowsCancellationException
```

**Error Message:**
```
System.Net.WebSockets.Client.Tests.CancelTest_HttpClient_Loopback.ConnectAsync_Cancel_ThrowsCancellationException(useSsl: False) [FAIL]

System.TimeoutException : The operation has timed out.

Stack Trace:

/_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(54,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)

/_/src/libraries/System.Net.WebSockets.Client/tests/LoopbackServer/LoopbackWebSocketServer.Http.cs(32,0): at System.Net.WebSockets.Client.Tests.LoopbackWebSocketServer.HttpRunner.RunAsync(Func`2 clientFunc, Func`3 wsServerFunc, Options options, CancellationToken clientExitCt, CancellationToken globalCt)

--- End of stack trace from previous location ---
```

**Stack Trace:**
```
Stack Trace:

/_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(54,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)

/_/src/libraries/System.Net.WebSockets.Client/tests/LoopbackServer/LoopbackWebSocketServer.Http.cs(32,0): at System.Net.WebSockets.Client.Tests.LoopbackWebSocketServer.HttpRunner.RunAsync(Func`2 clientFunc, Func`3 wsServerFunc, Options options, CancellationToken clientExitCt, CancellationToken globalCt)

--- End of stack trace from previous location ---
```

**Analysis:**
The test sets up a loopback websocket server and calls ConnectAsync with a cancellation token, expecting a CancellationException; instead the internal WhenAllOrAnyFailed helper times out (the cancellation either does not propagate or the server-side task hangs) under jitstress2 codegen on windows x64. The closest issue from validator substring search (#121518) is about a different scenario (os-android System.Net.WebSockets.Client.Tests work-item-level failure). The historical #58355 is closed (milestone 9.0.0) with a different failure mode (Assert.Throws no exception thrown). No OPEN matching issue for this TimeoutException form of the test under jitstress2 on windows x64. Flagged as NEW.

**Generated by ci-pipeline-monitor/scripts/update_github.py**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.