-
Notifications
You must be signed in to change notification settings - Fork 418
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
Headless Chrome test fails #611
Comments
Thanks for the report! Can you rerun the build with |
Thanks! From the logs it looks like Chrome may be crashing on startup somehow? Unfortunately though it's not clear why chrome is crashing :( Perhaps you can google around with that error message and your setup and see if something pops up? |
Unfortunately I'm a bit stumped on what to do. I tried starting chrome with the parameters outlined in the log ( edit: To clarify, when I google I do find people with similar problems, but I either don't understand the solutions or just can't apply them because I'm not calling chromedriver/chrome the same way they do. In fact I have no idea how I call it, I'm just using |
I think that In general the bug is actually moreso for https://github.com/rustwasm/wasm-bindgen than wasm-pack since the test harness lives in that repository. Perhaps the best way to debug this would be to be able to build a copy of that locally and work with that? If you could poke around the code there and see if inserting some debugging would help, that may help reproduce the issue? I've sometimes had luck in the past as well passing extra arguments to the webdriver binaries. If there's like a verbose logging option for chromedriver you could try turning that on with |
Thanks for the pointers! I don't know when/if I'll have time to do that and investigate further. I found this bug while checking out Rust/Webassembly, but I don't currently use it anywhere, so other things are more pressing to me. |
Ok no worries, thanks for the help so far @TobiasWehrum! We'll leave this open for now to see if others end up having it, and next time I get access to Windows I can try to reproduce myself too |
cc @steveklabnik if you have some extra cycles if you could try to reproduce that'd be great |
So, I'm getting some weirdness, but different weirdness:
When running manually:
|
With that being said, noticing the output above, the "no tests to run" is expected, and when running the correct thing:
It seems that the |
I have the same problem as @TobiasWehrum with this output: $ wasm-pack test --chrome --headless
[INFO]: Checking for the Wasm target...
Compiling proc-macro2 v0.4.30
Compiling wasm-bindgen-test v0.2.48
Finished dev [unoptimized + debuginfo] target(s) in 1m 15s
[INFO]: Installing wasm-bindgen...
[INFO]: Getting chromedriver...
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running target\wasm32-unknown-unknown\debug\deps\wasm_game_of_life-e02c4c95b90047dd.wasm
no tests to run!
Running target\wasm32-unknown-unknown\debug\deps\web-3f614aae3963f555.wasm
Running headless tests in Chrome with `C:\Users\Lukas\AppData\Local\.wasm-pack\chromedriver-87c19a493f3a2690\chromedriver.exe`
Starting new webdriver session...
DevTools listening on ws://127.0.0.1:53240/devtools/browser/be4deb2e-9471-4087-aa1b-cb92d15c864b
driver status: exit code: 1
driver stdout:
Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 53237
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
error: failed to find element reference in response
error: test failed, to rerun pass '--test web'
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit code: 1 This is on Windows 10 Pro 1903 with
Let me know if you need any additional info. For the time being, I'll use the FireFox headless mode. |
I think it's because of incompatible Explanation Suggestions Workarounds
install:
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
- source ~/.nvm/nvm.sh
- nvm install v10.5
- npm install -g chromedriver
- which chromedriver # just for easier debugging
|
Looks like a lot of updates have happened since we first added this! Let's download the most recent stable version. Closes rustwasm#611
Nice find @MartinKavik! I've posted #703 to update the version we download |
@alexcrichton Can I try to make it more automatic (probably add a Chrome version check or try to download latest stable driver instead of a hard-coded one) before we close this issue? |
Oh certainly! I'll let you take care of this since it's probably gonna be more invasive than #703 anyway |
Anyone know an easy workaround while we want for #703 to land and be included in an update? |
@andrewdavidmackenzie Workarounds in #611 (comment) are not usable for you? |
I ended up manually installing latest chromedriver via brew and that fixed it, not sure about my travis job yet though. (didn't want to switch to FF just for this....but can do if this doesn't work). Thanks |
As described in workaround here: rustwasm/wasm-pack#611 (comment)
I have the same issue as @TobiasWehrum had. I just wanted to mention that I am running Linux and this is probably not a windows-only issue then (as suggested by the label). As a little addendum, my error message looks like this:
|
This just occurred to me on Linux (Fedora 37) with a very similar error:
I'm not sure why, but |
🐛 Bug description
I'm currently following this tutorial: https://rustwasm.github.io/docs/book/game-of-life/testing.html. The default tests/web.rs file looks like this:
The tutorial suggests that I run
wasm-pack test --chrome --headless
to "confirm that the Rust-generated WebAssembly test is working". Instead it fails with the following output:Running the test with
wasm-pack test --chrome
(and opening the page in chrome) is successful, as is runningwasm-pack test --firefox --headless
.🤔 Expected Behavior
The test should work and succeed for chrome headless mode.
👟 Steps to reproduce
cargo generate --git https://github.com/rustwasm/wasm-pack-template
cd wasm-game-of-life
wasm-pack test --chrome --headless
🌍 Your environment
wasm-pack version: 0.7.0
rustc version: 1.33.0
System: Windows 7 64bit
Chrome: 73.0.3683.86 (official build) (64-Bit)
The text was updated successfully, but these errors were encountered: