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

Cannot run wasm-bindgen's tests. "error: missing field sessionId at line 1 column 259" #1272

Closed
ZacLiveEarth opened this issue Feb 18, 2019 · 6 comments

Comments

@ZacLiveEarth
Copy link

Steps to reproduce:

Output:

    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
     Running target\wasm32-unknown-unknown\debug\deps\headless-7111f92aebb68cba.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.33s
     Running `target\debug\wasm-bindgen-test-runner.exe C:\git\wasm-bindgen\target\wasm32-unknown-unknown\debug\deps\headless-7111f92aebb68cba.wasm`
Running headless tests in Firefox with `C:\geckodriver\chrome_72\chromedriver.exe`
driver status: exit code: 1
driver stdout:
    Starting ChromeDriver 73.0.3683.20 (8e2b610813e167eee3619ac4ce6e42e3ec622017) on port 52764
    Only local connections are allowed.
    Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

error: missing field `sessionId` at line 1 column 259
error: process didn't exit successfully: `target\debug\wasm-bindgen-test-runner.exe C:\git\wasm-bindgen\target\wasm32-unknown-unknown\debug\deps\headless-7111f92aebb68cba.wasm` (exit code: 1)
error: test failed, to rerun pass '--test headless'

One suspicious line is "Running headless tests in Firefox with C:\geckodriver\chrome_72\chromedriver.exe", which indicates mixing Firefox and Chrome. The setup page at https://rustwasm.github.io/wasm-bindgen/contributing/testing.html indicates that I can follow to ReadMe.md for instructions on configuring the browser, but there are no instructions about configuring a browser on that page.

@alexcrichton
Copy link
Contributor

Thanks for the report! This looks like it's somewhat of a mismatch though, you're using Chrome but Firefox's geckodriver is also in use?

Out of curiosity if you use wasm-pack does it solve the issue for you? (which should handle downloading all the drivers and whatnot)

@LegNeato
Copy link
Contributor

I'm seeing the same thing on High Sierra:

Running headless tests in Safari with `safaridriver`
driver status: signal: 9                          
error: missing field `sessionId` at line 1 column 400

@alexcrichton
Copy link
Contributor

@LegNeato just to confirm, it looks like chromedriver.exe above is being used to drive Firefox, but do you have something similar where safaridriver is driving something else perhaps? Could you provide the full logs you see?

@LegNeato
Copy link
Contributor

I'm not sure...a window flashes briefly but I can't see what app it is. I've never installed chromedriver or geckodriver, though I do have Firefox Nightly installed.

There is some interesting debug output:

[2019-02-26T16:13:29Z DEBUG walrus::module] emitting custom section __wasm_bindgen_test_unstable
[2019-02-26T16:13:29Z DEBUG walrus::module] emission finished
[2019-02-26T16:13:29Z DEBUG tiny_http] Server listening on 127.0.0.1:54335
[2019-02-26T16:13:29Z DEBUG tiny_http] Running accept thread
Running headless tests in Safari with `safaridriver`
[2019-02-26T16:13:29Z DEBUG wasm_bindgen_test_runner::headless] POST /session {"capabilities":{},"desiredCapabilities":{}}
[2019-02-26T16:13:30Z DEBUG wasm_bindgen_test_runner::headless] got: {"status":0,"sessionId":"7E00E58A-859E-4127-9E0A-F67FBE4CB647","value":{"version":"13605.3.8","rotatable":false,"applicationCacheEnabled":true,"databaseEnabled":true,"handlesAlerts":true,"cleanSession":true,"browserName":"safari","javascriptEnabled":true,"locationContextEnabled":false,"platform":"macOS","webStorageEnabled":true,"cssSelectorsEnabled":true,"nativeEvents":true,"platformName":"macOS"}}
driver status: signal: 9                          
error: missing field `sessionId` at line 1 column 400
[2019-02-26T16:13:30Z DEBUG cargo] exit_with_error; err=CliError { error: Some(ErrorMessage { msg: "test failed, to rerun pass \'--test headless\'" }), unknown: false, exit_code: 1 }
error: test failed, to rerun pass '--test headless'

So the webdriver server does return json with sessionId but for some reason the test harness doesn't see it.

@LegNeato
Copy link
Contributor

LegNeato commented Feb 26, 2019

Ok, not sure if these are the same issue anymore but I found the problem and have a fix. Will put up a PR for my bug and maybe it will fix this as well if it is the same underlying issue. Doubtful as my change is focused on safari.

@alexcrichton
Copy link
Contributor

I think this was fixed in #1298, so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants