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-mt] Fix cross-origin headers when running the browser threads sample test #74342

Merged

Conversation

simonrozsival
Copy link
Member

@simonrozsival simonrozsival commented Aug 22, 2022

The work item Wasm.Browser.Threads.Sample fails when multi-threading is enabled with the following log output:

[17:30:39] fail: [out of order message from the browser]: http://127.0.0.1:35659/main.js 10:24 ReferenceError: SharedArrayBuffer is not defined
                     at http://127.0.0.1:35659/dotnet.js:14:13769
                     at http://127.0.0.1:35659/main.js:64:87
[17:30:39] info: WASM EXIT 2
[17:30:39] info: Waiting to flush log messages with a timeout of 120 secs ..
[17:30:39] fail: Application has finished with exit code HELP_SHOWN but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)

This suggests that there is a problem with the Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers (see MDN). We need to pass the --web-server-use-cop option to xharness to resolve this problem.

With this fix, the test succeeds:

...
[14:41:36] info: Hello, World!
[14:41:36] info: [MONO] Running class .cctor for System.Runtime.InteropServices.JavaScript.JavaScriptExports/<>c from 'System.Runtime.InteropServices.JavaScript.dll'
[14:41:36] info: WASM EXIT 0
...
[14:41:36] info: WaitForCompletion completed on thread 1
XHarness exit code: 0

@simonrozsival simonrozsival added the NO-REVIEW Experimental/testing PR, do NOT review it label Aug 22, 2022
@ghost ghost assigned simonrozsival Aug 22, 2022
@simonrozsival
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@simonrozsival simonrozsival removed the NO-REVIEW Experimental/testing PR, do NOT review it label Aug 22, 2022
@simonrozsival simonrozsival marked this pull request as ready for review August 22, 2022 18:20
@simonrozsival simonrozsival merged commit 40749f6 into dotnet:main Aug 23, 2022
@simonrozsival simonrozsival deleted the fix-wasm-browser-threads-sample-test branch August 23, 2022 07:19
@ghost ghost locked as resolved and limited conversation to collaborators Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants