Skip to content

Commit e3fa31e

Browse files
authored
Fix race condition in panic_abort_tests (#15169)
This fixes a race condition in the `panic_abort_tests` test which can randomly fail. Prior to #14226 the test would check the lines individually (which was also kinda broken for the same reason, but wouldn't actually fail).
2 parents 3939918 + be6598b commit e3fa31e

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)