Fix race condition in panic_abort_tests

This commit is contained in:
Eric Huss 2025-02-10 13:15:15 -08:00
parent fcb79a5c45
commit be6598b7f0

View File

@ -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[..]`