Skip to content

Commit

Permalink
Fix race condition in panic_abort_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Feb 10, 2025
1 parent fcb79a5 commit be6598b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5009,7 +5009,11 @@ fn panic_abort_tests() {
.file("a/src/lib.rs", "pub fn foo() {}")
.build();

p.cargo("test -Z panic-abort-tests -v")
// This uses -j1 because of a race condition. Otherwise it will build the
// two copies of `foo` in parallel, and which one is first is random. If
// `--test` is first, then the first line with `[..]` will match, and the
// second line with `--test` will fail.
p.cargo("test -Z panic-abort-tests -v -j1")
.with_stderr_data(
str![[r#"
[RUNNING] `[..]--crate-name a [..]-C panic=abort[..]`
Expand Down

0 comments on commit be6598b

Please sign in to comment.