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

[wasm] System.Net.WebSockets.Client.Tests.CloseTest.CloseOutputAsync_ClientInitiated_CanReceive_CanClose failing on browser #65796

Closed
radical opened this issue Feb 23, 2022 · 4 comments · Fixed by #96618
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Net
Milestone

Comments

@radical
Copy link
Member

radical commented Feb 23, 2022

Hit on #65752 (unrelated PR).
Build, and log:

[18:43:39] info: Discovering: System.Net.WebSockets.Client.Tests.dll (method display = ClassAndMethod, method display options = None)
[18:43:39] info: Discovered:  System.Net.WebSockets.Client.Tests.dll (found 60 of 87 test cases)
[18:43:39] info: Using random seed for test cases: 808720396
[18:43:39] info: Using random seed for collections: 808720396
[18:43:39] info: Starting:    System.Net.WebSockets.Client.Tests.dll
[18:43:39] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://127.0.0.1:49168/WebSocket/EchoWebSocket.ashx?subprotocol=CustomProtocol' failed: Error during WebSocket handshake: Response must not include 'Sec-WebSocket-Protocol' header if not present in request: CustomProtocol
[18:43:39] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'wss://127.0.0.1:49169/WebSocket/EchoWebSocket.ashx?subprotocol=CustomProtocol' failed: Error during WebSocket handshake: Response must not include 'Sec-WebSocket-Protocol' header if not present in request: CustomProtocol
[18:43:40] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://127.0.0.1:49186/' failed: Connection closed before receiving a handshake response
[18:43:42] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://bf8a6a8eb73143a0ab2f9fea8dba8dca/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
[18:43:50] warn: WARNING: Web browsers do not support closing the output side of a WebSocket. CloseOutputAsync has closed the socket and discarded any incoming messages.
[18:45:15] fail: [FAIL] System.Net.WebSockets.Client.Tests.CloseTest.CloseOutputAsync_ClientInitiated_CanReceive_CanClose(server: wss://127.0.0.1:49169/WebSocket/EchoWebSocket.ashx)
[18:45:15] info: Assert.Equal() Failure
[18:45:15] info: Expected: 17
[18:45:15] info: Actual:   0
[18:45:15] info:    at System.Net.WebSockets.Client.Tests.CloseTest.CloseOutputAsync_ClientInitiated_CanReceive_CanClose(Uri server)
[18:45:16] info: --- End of stack trace from previous location ---
[18:46:20] info: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://127.0.0.1:49168/WebSocket/EchoWebSocket.ashx?delay10sec' failed: WebSocket is closed before the connection is established.
[18:46:20] info: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'wss://127.0.0.1:49169/WebSocket/EchoWebSocket.ashx?delay10sec' failed: WebSocket is closed before the connection is established.
[18:46:20] info: Finished:    System.Net.WebSockets.Client.Tests.dll

cc @pavelsavara

@radical radical added arch-wasm WebAssembly architecture area-System.Net labels Feb 23, 2022
@ghost
Copy link

ghost commented Feb 23, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Hit on #65752 (unrelated PR).
Build, and log:

[18:43:39] info: Discovering: System.Net.WebSockets.Client.Tests.dll (method display = ClassAndMethod, method display options = None)
[18:43:39] info: Discovered:  System.Net.WebSockets.Client.Tests.dll (found 60 of 87 test cases)
[18:43:39] info: Using random seed for test cases: 808720396
[18:43:39] info: Using random seed for collections: 808720396
[18:43:39] info: Starting:    System.Net.WebSockets.Client.Tests.dll
[18:43:39] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://127.0.0.1:49168/WebSocket/EchoWebSocket.ashx?subprotocol=CustomProtocol' failed: Error during WebSocket handshake: Response must not include 'Sec-WebSocket-Protocol' header if not present in request: CustomProtocol
[18:43:39] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'wss://127.0.0.1:49169/WebSocket/EchoWebSocket.ashx?subprotocol=CustomProtocol' failed: Error during WebSocket handshake: Response must not include 'Sec-WebSocket-Protocol' header if not present in request: CustomProtocol
[18:43:40] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://127.0.0.1:49186/' failed: Connection closed before receiving a handshake response
[18:43:42] fail: [out of order message from the browser]: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://bf8a6a8eb73143a0ab2f9fea8dba8dca/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
[18:43:50] warn: WARNING: Web browsers do not support closing the output side of a WebSocket. CloseOutputAsync has closed the socket and discarded any incoming messages.
[18:45:15] fail: [FAIL] System.Net.WebSockets.Client.Tests.CloseTest.CloseOutputAsync_ClientInitiated_CanReceive_CanClose(server: wss://127.0.0.1:49169/WebSocket/EchoWebSocket.ashx)
[18:45:15] info: Assert.Equal() Failure
[18:45:15] info: Expected: 17
[18:45:15] info: Actual:   0
[18:45:15] info:    at System.Net.WebSockets.Client.Tests.CloseTest.CloseOutputAsync_ClientInitiated_CanReceive_CanClose(Uri server)
[18:45:16] info: --- End of stack trace from previous location ---
[18:46:20] info: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'ws://127.0.0.1:49168/WebSocket/EchoWebSocket.ashx?delay10sec' failed: WebSocket is closed before the connection is established.
[18:46:20] info: http://127.0.0.1:49168/dotnet.js 2 WebSocket connection to 'wss://127.0.0.1:49169/WebSocket/EchoWebSocket.ashx?delay10sec' failed: WebSocket is closed before the connection is established.
[18:46:20] info: Finished:    System.Net.WebSockets.Client.Tests.dll

cc @pavelsavara

Author: radical
Assignees: -
Labels:

arch-wasm, area-System.Net

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 23, 2022
@lewing lewing added this to the 7.0.0 milestone Feb 25, 2022
@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Feb 25, 2022
@ilonatommy
Copy link
Member

I can't reproduce it, can you @pavelsavara? Is it probable that it got fixed? Test itself does not have any recent changes.

@pavelsavara
Copy link
Member

Let's close it and re-open if it appears again.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2022
@antonfirsov
Copy link
Member

Hit in #91910. There were several hits in August according to Kusto. Low frequency but reopening for more triage.

cluster('engsrvprod.kusto.windows.net').database('engineeringdata').AzureDevOpsTests
   | where TestName startswith "System.Net"
       and Outcome == 'Failed' or Outcome == 'PassedOnRerun'
   | extend i = indexof_regex(TestName, @"[^.]+$")
   | extend Method = substring(TestName, i)
   | extend Type = substring(TestName, 0, i - 1)
   | project-away i, TestName
   | where Method has 'CloseOutputAsync_ClientInitiated_CanReceive_CanClose'
   | distinct JobId, WorkItemId, Message, StackTrace, Method, Type, Arguments, Outcome
   | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').Jobs
       | where Finished > now(-40d)
       | extend TargetBranch = extractjson("$.['System.PullRequest.TargetBranch']", Properties)
       | where (Branch == 'refs/heads/main') or (Source startswith "pr/" and TargetBranch == 'main')
       | where Type startswith "test/functional/cli/" and not(Properties contains "runtime-staging")
       | summarize arg_max(Finished, Properties, Type, Branch, Source, Started, QueueName, Attempt, Build, TargetBranch) by JobId
   | project-rename JobType = Type) on JobId
   | extend PropertiesJson = parse_json(Properties)
   | extend OS = replace_regex(tostring(PropertiesJson.operatingSystem), @'\((.*)\).*|([^\(].*)', @'\1\2')
   | extend Runtime = iif(PropertiesJson.runtimeFlavor == "mono", "Mono", iif(PropertiesJson.DefinitionName contains "coreclr", "CoreCLR", ""))
   | extend Architecture = PropertiesJson.architecture
   | extend DefinitionName = PropertiesJson.DefinitionName
   | project-away JobId
   | extend JobId = extractjson("$.['System.JobId']", Properties)
   | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').WorkItems
       | project-keep ConsoleUri, WorkItemId) on WorkItemId
   | project-away PropertiesJson
   | project-reorder Started, Type, Method, Arguments, StackTrace, ConsoleUri, OS, Architecture, DefinitionName, Branch, TargetBranch, Attempt, Build, *
;

@antonfirsov antonfirsov reopened this Sep 13, 2023
@dotnet dotnet unlocked this conversation Nov 24, 2023
@akoeplinger akoeplinger modified the milestones: 7.0.0, 9.0.0 Dec 6, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 14, 2024
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Net
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants