Skip to content

System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException failures in OSX #38159

Description

@safern

System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException

Console Log Summary

Builds

Build Pull Request Test Failure Count
#694781 #38089 1
#695034 #38109 1
#695665 Rolling 1

Configurations

  • net5.0-OSX-Debug-x64-CoreCLR_checked-OSX.1013.Amd64.Open
  • net5.0-OSX-Debug-x64-CoreCLR_release-OSX.1013.Amd64.Open
  • net5.0-OSX-Release-x64-CoreCLR_release-OSX.1013.Amd64.Open

Helix Logs

Build Pull Request Console Core Test Results Run Client
#694781 #38089 console.log testResults.xml run_client.py
#695034 #38109 console.log testResults.xml run_client.py
#695665 Rolling console.log testResults.xml run_client.py

This is over the past 100 builds.

System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException [FAIL]
      System.Net.Sockets.SocketException : Invalid argument
      Stack Trace:
        /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(5173,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
        /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(4694,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent)
        /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(1871,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
        /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(631,0): at System.Net.Sockets.Socket.set_NoDelay(Boolean value)
        /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(97,0): at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync()
        /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(130,0): at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(83,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(111,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(83,0): at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext()
        --- End of stack trace from previous location ---
        /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(67,0): at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
        /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs(264,0): at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException()
        --- End of stack trace from previous location ---

cc: @dotnet/ncl @stephentoub

Activity

  1. added
    os-macos
    blocking-clean-ci
    on Jun 19, 2020
  2. added
    untriaged
    on Jun 19, 2020
  3. wfurt commented on Jun 19, 2020

    @wfurt
    Member

    interesting

     System.Net.Sockets.SocketException : Invalid argument
    

    envoyproxy/envoy#1446 suggests that we can get that if peer shutdown their side. We have seen something similar with getpeername() in Socket from fd code. Maybe loopback should just eat that exception. Perhaps NoDelay should be best effort.

  4. added this to the Future milestone on Jun 25, 2020
  5. removed
    untriaged
    on Jun 25, 2020
  6. ericstj commented on Jul 11, 2020

    @ericstj
    Member

    Same test just failed for me:
    https://dev.azure.com/dnceng/public/_build/results?buildId=725147&view=ms.vss-test-web.build-test-results-tab&runId=22479114&resultId=126814&paneView=debug
    In #39101

        System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException [FAIL]
          System.IO.IOException : The operation is not allowed on non-connected sockets.
          Stack Trace:
            /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs(57,0): at System.Net.Sockets.NetworkStream..ctor(Socket socket, FileAccess access, Boolean ownsSocket)
            /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs(32,0): at System.Net.Sockets.NetworkStream..ctor(Socket socket, Boolean ownsSocket)
            /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(103,0): at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync()
            /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(134,0): at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync)
            /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(82,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
            /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(110,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
            /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(82,0): at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext()
            --- End of stack trace from previous location ---
            /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs(66,0): at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
            /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs(263,0): at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException()
            --- End of stack trace from previous location ---
    
  7. wfurt commented on Jul 11, 2020

    @wfurt
    Member

    This is interesting. The socket should be in connected state once Accept is finished. Unless explicit Disconnect or Dispose() is called.
    Duration 0:00:00.497. Since the test really tests aborting connection, perhaps we can wrap the server in try/catch and ignore all errors.

  8. jkotas commented on Aug 23, 2020

    @jkotas
    Member

    Hit in #41234

  9. ghost locked as resolved and limited conversation to collaborators on Dec 8, 2020
  10. modified the milestones: Future, 6.0.0 on Jan 26, 2021
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

    area-System.Netblocking-clean-cios-macos

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions