Repository navigation
Test failure: ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException: SocketException in the loopback server's AcceptAsync #135664
Description
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1632739
Build error leg or test failing: System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException
Pull request: #135566
Error Message
DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.
Fill the error message using step by step known issues guidance.
{
"ErrorMessage": ["ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException [FAIL]", "An existing connection was forcibly closed by the remote host."],
"BuildRetry": false,
"ExcludeConsoleLog": false
}Error Details
One test failed in the System.Net.WebSockets.Client.Tests work item on Windows x86 with checked CoreCLR: the loopback server's AcceptAsync threw SocketException (connection reset). The PR changes reflection invoke and delegate creation for static abstract interface methods; it changes no networking code.
System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException [FAIL]
Failing Configuration
net11.0-windows-Debug-x86-coreclr_checked-Windows.10.Amd64.Open
Exception Message
System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host.
CallStack
/_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs(1365,0): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
/_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs(1302,0): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Net.Sockets.Socket>.GetResult(Int16 token)
/_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs(32,0): at System.Net.Sockets.Socket.AcceptAsync()
/_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(142,0): at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync()
/_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(162,0): at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync()
/_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(168,0): at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync)
/_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.SharedHandler.cs(83,0): at System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.<>c__DisplayClass4_0.<ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException>b__1(LoopbackServer server)
Build Analysis gives this test a 0.03% failure rate. Earlier reports of the same test, all closed: #132993, #56688, #41511.
Note
AI-generated, written at my direction and reviewed by me before posting. The failure text is from build 1632739's Helix console log (System.Net.WebSockets.Client.Tests, lines 58-67); the earlier reports are from a search/issues query on the test name.
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1632739
Error message validated: [ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException [FAIL] An existing connection was forcibly closed by the remote host.]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 10/13/2026 1:05:51 PM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 1 | 3 |
Activity
dotnet-policy-service commentedon Oct 13, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
caraioniurie47 commentedon Oct 13, 2026
Could someone add the
Known Build Errorandblocking-clean-cilabels? The issue form's labels didn't apply, so Build Analysis doesn't match this yet (it fails PR #135566's check). Thanks.