Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
safern opened this issue Jun 19, 2020 · 5 comments · Fixed by #38900 or #42054
Labels
area-System.Net blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-mac-os-x macOS aka OSX
Milestone

Comments

@safern
Copy link
Member

safern commented Jun 19, 2020

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

@safern safern added os-mac-os-x macOS aka OSX blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Jun 19, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Net untriaged New issue has not been triaged by the area owner labels Jun 19, 2020
@ghost
Copy link

ghost commented Jun 19, 2020

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

@wfurt
Copy link
Member

wfurt commented Jun 19, 2020

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.

@scalablecory scalablecory added this to the Future milestone Jun 25, 2020
@scalablecory scalablecory removed the untriaged New issue has not been triaged by the area owner label Jun 25, 2020
@ericstj
Copy link
Member

ericstj commented Jul 11, 2020

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 ---

@ericstj ericstj reopened this Jul 11, 2020
@wfurt
Copy link
Member

wfurt commented Jul 11, 2020

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.

@jkotas
Copy link
Member

jkotas commented Aug 23, 2020

Hit in #41234

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-mac-os-x macOS aka OSX
Projects
None yet
7 participants