Skip to content

Test failure: ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException: SocketException in the loopback server's AcceptAsync #135664

Open

Description

@caraioniurie47

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

Build Repository Test Pull Request
1647613 dotnet/runtime System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException #136406
1638222 dotnet/runtime System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException #135956
1632739 dotnet/runtime System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException #135566

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 3

Activity

  1. dotnet-policy-service commented on Oct 13, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @karelz, @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  2. caraioniurie47 commented on Oct 13, 2026

    @caraioniurie47
    ContributorAuthor

    Could someone add the Known Build Error and blocking-clean-ci labels? The issue form's labels didn't apply, so Build Analysis doesn't match this yet (it fails PR #135566's check). Thanks.

  3. added
    Known Build ErrorUse this to report build issues in the .NET Helix tab
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build ErrorUse this to report build issues in the .NET Helix tabarea-System.Net.Socketsblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'untriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions