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

cargo test sometimes fails with Broken pipe (os error 32) under aarch64 #1820

Closed
ereslibre opened this issue Sep 25, 2024 · 2 comments · Fixed by #1821
Closed

cargo test sometimes fails with Broken pipe (os error 32) under aarch64 #1820

ereslibre opened this issue Sep 25, 2024 · 2 comments · Fixed by #1821

Comments

@ereslibre
Copy link

Hello!

This bug is not always reproducible, but in my environment happens around ~60% of the runs. One example of the failure:

❯ cargo test -p wasm-tools --all

...

test "tests/cli/semver-check-add-imports.wit"                                  ... ok
test "tests/cli/add-metadata.wat"                                              ... ok
test "tests/cli/world-merging-export-conflict.wit"                             ... ok

failures:

---- "tests/cli/unbundle-print-module1.wat" ----
failed test "tests/cli/unbundle-print-module1.wat"

Caused by:
    Broken pipe (os error 32)


failures:
    "tests/cli/unbundle-print-module1.wat"

test result: FAILED. 105 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.14s

error: test failed, to rerun pass `-p wasm-tools --test cli`

Sometimes it's this test, sometimes it's others. Another example: NixOS/nixpkgs#341059 (comment)

What all failing tests have in common though, is that they use the tmpdir and pipe feature of the tests.

I can confirm that I could not reproduce the issue after setting --test-threads=1 during the cargo test execution, like:

$ cargo test -p wasm-tools --all -- --test-threads=1
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue Sep 25, 2024
Some tests were modeled as "do a thing piped into another thing" but the
second command didn't actually take any input. That meant that writing
the stdout of the previous command into the next command might sometimes
fail if the second command finishes before the write finishes. This
commit fixes the various affected tests with the now-added ability to
run multiple separate commands in a single file. These failures were
detected by inserting a `sleep` before writing stdin and then fixing all
tests.

Closes bytecodealliance#1820
@alexcrichton
Copy link
Member

Thanks for the report, and sorry for the breakage! This should be fixed in #1821

@ereslibre
Copy link
Author

Oh wow, lightning fast; thanks a ton @alexcrichton!

github-merge-queue bot pushed a commit that referenced this issue Sep 25, 2024
Some tests were modeled as "do a thing piped into another thing" but the
second command didn't actually take any input. That meant that writing
the stdout of the previous command into the next command might sometimes
fail if the second command finishes before the write finishes. This
commit fixes the various affected tests with the now-added ability to
run multiple separate commands in a single file. These failures were
detected by inserting a `sleep` before writing stdin and then fixing all
tests.

Closes #1820
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

Successfully merging a pull request may close this issue.

2 participants