Skip to content

Commit be6598b

Browse files
committed
Fix race condition in panic_abort_tests
1 parent fcb79a5 commit be6598b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/testsuite/test.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -5009,7 +5009,11 @@ fn panic_abort_tests() {
50095009
.file("a/src/lib.rs", "pub fn foo() {}")
50105010
.build();
50115011

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

0 commit comments

Comments
 (0)