nimiq / core-rs-albatross

Rust implementation of the Albatross protocol
https://nimiq.com
Other
165 stars 67 forks source link

web-client tests: Error: driver failed to bind port during startup #2830

Open hrxi opened 3 months ago

hrxi commented 3 months ago

Looks like a spurious failure.

https://github.com/nimiq/core-rs-albatross/actions/runs/10389615326/job/28768041598?pr=2798

    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.34s
     Running unittests src/lib.rs (/home/runner/work/core-rs-albatross/core-rs-albatross/target/wasm32-unknown-unknown/debug/deps/nimiq_web_client-3049256029994952.wasm)
Set timeout to 20 seconds...
Executing bindgen...                              

driver status: signal: 9 (SIGKILL)
driver stdout:
    Starting ChromeDriver 127.0.6533.99 (f31af5097d90ef5ae5bd7b8700199bc6189ba34d-refs/branch-heads/6533@{#1910}) on port 40529
    Only local connections are allowed.
    Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.

Error: driver failed to bind port during startup
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/home/runner/.cache/.wasm-pack/wasm-bindgen-55453f1f0ef1a1d5/wasm-bindgen-test-runner /home/runner/work/core-rs-albatross/core-rs-albatross/target/wasm32-unknown-unknown/debug/deps/nimiq_web_client-3049256029994952.wasm` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit status: 1
  full command: cd "/home/runner/work/core-rs-albatross/core-rs-albatross/web-client" && CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER="/home/runner/.cache/.wasm-pack/wasm-bindgen-55453f1f0ef1a1d5/wasm-bindgen-test-runner" CHROMEDRIVER="/usr/bin/chromedriver" WASM_BINDGEN_TEST_ONLY_WEB="1" "cargo" "test" "--target" "wasm32-unknown-unknown"

Error: Process completed with exit code 1.
Eligioo commented 3 months ago

Location where error occurs: https://github.com/rustwasm/wasm-bindgen/blob/b012a75b44c61abf53003206074c3b6801dd5511/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs#L81-L94. The headless test server is unreachable for more than 5 seconds.

One thing I found is, but probably not the reason thus unrelated: https://github.com/rustwasm/wasm-bindgen/pull/3873. The headless test server might open on a different port every time and if we would use WASM_BINDGEN_TEST_ADDRESS, which we don't, it wouldn't pick up the correct port the server is running on.

I don't know how resource intensive it is to setup this headless test server but maybe this needs more time since these CI runners have very low specs.