wasm-bindgen
wasm-bindgen copied to clipboard
Headless browser tests in Safari fail since 0.2.82
Describe the Bug
After the wasm-bindgen update to version 0.2.82, my project's headless browser tests constantly fail in Safari. No problems exist in Firefox and Chrome. There are no such problems with the previous version 0.2.81.
Steps to Reproduce
- Update wasm-bindgen to version 0.2.82.
- On macOS, run
sudo safaridriver --enable
andwasm-pack test --headless --safari
.
Expected Behavior
The tests should run successfully.
Actual Behavior
The tests fail with the following error:
Running headless tests in Safari on `[http://127.0.0.1:49974/`](http://127.0.0.1:49974/%60)
Try find `webdriver.json` for configure browser's capabilities:
Not found
Starting new webdriver session...
Error: non-200 response code: 500
Visiting http://127.0.0.1:49973.../
{"value":{"error":"unknown error","message":"","stacktrace":""}}
I saw this error in my project's CI pipeline for the first time but I can also reproduce it on my local machine.
This seems to have been introduced in #2936.
Okay, this seems to be a bug in safaridriver
- navigating to any page with Cross-Origin-Opener-Policy: same-origin
causes it to crash.
I can confirm that I'm encountering the exact same error with safaridriver
. This issue seems to occur on both MacOS 11 and 12, and it still occurs with the most recent wasm-bindgen-test-runner
0.2.83. Is there a way to work around this (maybe by adding an option to not emit the COOP headers).
Could this be the following webkit bug: https://bugs.webkit.org/show_bug.cgi?id=233391
We could stop emitting the headers when using safaridriver
and instead use JSC_useSharedArrayBuffer
.
See https://webkit.org/blog/11364/release-notes-for-safari-technology-preview-117.
Would make the PR myself but don't have access to an Apple device.
I can no longer reproduce this, so I think the bug in safaridriver
might have been fixed.
It might've been fixed in 16.4, since the release notes have a vague mention of 'Fixed automation sessions terminating during navigation'.
@pemistahl or @josephlr, can you confirm that it's also fixed for you?
I can confirm that this was fixed, using it in multiple CIs on GitHub Actions and tested on desktop Safari v16.4 as well.
Great!
Yes, the bug has been fixed, apparently. My tests pass now again. :)