about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-11-17 21:05:11 -0500
committerBen Kimock <kimockb@gmail.com>2023-11-20 09:36:40 -0500
commit9ada6544f64fb85d9f0ffa54f1f5fa4ea3731df9 (patch)
treef841f07cc4b3749918a3221c3e6381da2a8b5b49
parentb99165842df821a4f067ff20d8119c53fc6d54f6 (diff)
downloadrust-9ada6544f64fb85d9f0ffa54f1f5fa4ea3731df9.tar.gz
rust-9ada6544f64fb85d9f0ffa54f1f5fa4ea3731df9.zip
Test with -Zmiri-provenance-gc=1 on Linux
-rwxr-xr-xsrc/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh11
-rw-r--r--src/tools/miri/tests/pass/0weak_memory_consistency.rs4
2 files changed, 13 insertions, 2 deletions
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh
index 821a09feb2d..205ee263217 100755
--- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh
@@ -25,7 +25,16 @@ cat /tmp/toolstate/toolstates.json
 python3 "$X_PY" test --stage 2 check-tools
 python3 "$X_PY" test --stage 2 src/tools/clippy
 python3 "$X_PY" test --stage 2 src/tools/rustfmt
-python3 "$X_PY" test --stage 2 src/tools/miri
+
+# Testing Miri is a bit more complicated.
+# We set the GC interval to the shortest possible value (0 would be off) to increase the chance
+# that bugs which only surface when the GC runs at a specific time are more likely to cause CI to fail.
+# This significantly increases the runtime of our test suite, or we'd do this in PR CI too.
+if [[ -z "${PR_CI_JOB:-}" ]]; then
+    MIRIFLAGS=-Zmiri-provenance-gc=1 python3 "$X_PY" test --stage 2 src/tools/miri
+else
+    python3 "$X_PY" test --stage 2 src/tools/miri
+fi
 # We natively run this script on x86_64-unknown-linux-gnu and x86_64-pc-windows-msvc.
 # Also cover some other targets via cross-testing, in particular all tier 1 targets.
 export BOOTSTRAP_SKIP_TARGET_SANITY=1 # we don't need `cc` for these targets
diff --git a/src/tools/miri/tests/pass/0weak_memory_consistency.rs b/src/tools/miri/tests/pass/0weak_memory_consistency.rs
index abfe3b0adeb..1cbccb2eebd 100644
--- a/src/tools/miri/tests/pass/0weak_memory_consistency.rs
+++ b/src/tools/miri/tests/pass/0weak_memory_consistency.rs
@@ -1,4 +1,6 @@
-//@compile-flags: -Zmiri-ignore-leaks -Zmiri-disable-stacked-borrows
+//@compile-flags: -Zmiri-ignore-leaks -Zmiri-disable-stacked-borrows -Zmiri-provenance-gc=10000
+// This test's runtime explodes if the GC interval is set to 1 (which we do in CI), so we
+// override it internally back to the default frequency.
 
 // The following tests check whether our weak memory emulation produces
 // any inconsistent execution outcomes