From 63eae2b30fcb249fd5cb412b5f23ee14a21dd192 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 28 Nov 2022 08:48:49 +0100 Subject: [PATCH] add many-seeds capabilities to CI --- src/tools/miri/ci.sh | 11 ++++++++--- src/tools/miri/tests/many-seeds/scoped-thread-leak.rs | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 src/tools/miri/tests/many-seeds/scoped-thread-leak.rs diff --git a/src/tools/miri/ci.sh b/src/tools/miri/ci.sh index dd2d2abe35b..e455b482338 100755 --- a/src/tools/miri/ci.sh +++ b/src/tools/miri/ci.sh @@ -40,10 +40,15 @@ function run_tests { ./miri test if [ -z "${MIRI_TEST_TARGET+exists}" ]; then # Only for host architecture: tests with optimizations (`-O` is what cargo passes, but crank MIR - # optimizations up all the way). - # Optimizations change diagnostics (mostly backtraces), so we don't check them - #FIXME(#2155): we want to only run the pass and panic tests here, not the fail tests. + # optimizations up all the way, too). + # Optimizations change diagnostics (mostly backtraces), so we don't check + # them. Also error locations change so we don't run the failing tests. MIRIFLAGS="${MIRIFLAGS:-} -O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic} + + # Also run some many-seeds tests. 64 seeds means this takes around a minute per test. + for FILE in tests/many-seeds/*.rs; do + MIRI_SEEDS=64 CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS -q" ./miri many-seeds ./miri run "$FILE" + done fi ## test-cargo-miri diff --git a/src/tools/miri/tests/many-seeds/scoped-thread-leak.rs b/src/tools/miri/tests/many-seeds/scoped-thread-leak.rs new file mode 100644 index 00000000000..f28e43696f7 --- /dev/null +++ b/src/tools/miri/tests/many-seeds/scoped-thread-leak.rs @@ -0,0 +1,8 @@ +//! Regression test for https://github.com/rust-lang/miri/issues/2629 +use std::thread; + +fn main() { + thread::scope(|s| { + s.spawn(|| {}); + }); +} -- 2.44.0