wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

Headless browser tests in Safari fail since 0.2.82

Open pemistahl opened this issue 1 year ago • 2 comments

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

  1. Update wasm-bindgen to version 0.2.82.
  2. On macOS, run sudo safaridriver --enable and wasm-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.

pemistahl avatar Jul 26 '22 08:07 pemistahl

This seems to have been introduced in #2936.

Liamolucko avatar Jul 26 '22 10:07 Liamolucko

Okay, this seems to be a bug in safaridriver - navigating to any page with Cross-Origin-Opener-Policy: same-origin causes it to crash.

Liamolucko avatar Jul 26 '22 10:07 Liamolucko

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

josephlr avatar Oct 26 '22 04:10 josephlr

Could this be the following webkit bug: https://bugs.webkit.org/show_bug.cgi?id=233391

josephlr avatar Feb 23 '23 01:02 josephlr

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.

daxpedda avatar Feb 24 '23 05:02 daxpedda

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?

Liamolucko avatar Jun 08 '23 06:06 Liamolucko

I can confirm that this was fixed, using it in multiple CIs on GitHub Actions and tested on desktop Safari v16.4 as well.

daxpedda avatar Jun 08 '23 06:06 daxpedda

Great!

Liamolucko avatar Jun 08 '23 06:06 Liamolucko

Yes, the bug has been fixed, apparently. My tests pass now again. :)

pemistahl avatar Jun 08 '23 14:06 pemistahl