Skip to content

[wasm] Don't throw if messages are received after the message processor#953

Merged
radical merged 1 commit intodotnet:mainfrom
radical:wasm-dont-fail
Sep 23, 2022
Merged

[wasm] Don't throw if messages are received after the message processor#953
radical merged 1 commit intodotnet:mainfrom
radical:wasm-dont-fail

Conversation

@radical
Copy link
Member

@radical radical commented Sep 21, 2022

.. has stopped running, so we don't miss any messages.

In some cases a wasm test app can emit WASM EXIT message more than once. First one triggers shutting down the whole thing, and any messages received after that can end up throwing because the message processor is no longer running.

Example failure:

[11:19:06] fail: 218355552
[11:19:06] info: WASM EXIT 1
[11:19:06] info: Waiting to flush log messages with a timeout of 120 secs ..
[11:19:06] info: WASM EXIT 1
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMKQV6N2NQ5F", Request id "0HMKQV6N2NQ5F:00000001": An unhandled exception was thrown by the application.
      System.InvalidOperationException: Message processor is not running. Make sure to call RunAsync first
         at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestMessagesProcessor.InvokeAsync(String message, Boolean isError) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/WasmTestMessagesProcessor.cs:line 94
         at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmBrowserTestRunner.RunConsoleMessagesPump(WebSocket socket, CancellationToken token) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmBrowserTestRunner.cs:line 196
         at Microsoft.DotNet.XHarness.CLI.Commands.WebServer.TestWebServerStartup.<>c__DisplayClass3_0.<<Configure>b__2>d.MoveNext() in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WebServer.cs:line 163
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
[11:19:06] fail: Application has finished with exit code TESTS_FAILED but 0 was expected

.. has stopped running, so we don't miss any messages.

In some cases a wasm test app can emit `WASM EXIT` message more than
once. First one triggers shutting down the whole thing, and any messages
received after that can end up throwing because the message processor is
no longer running.
@radical radical added the wasm WASM area label Sep 21, 2022
@radical radical merged commit a8e8fc0 into dotnet:main Sep 23, 2022
@radical radical deleted the wasm-dont-fail branch September 23, 2022 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasm WASM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants