about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-05-30 09:05:03 +0200
committerRalf Jung <post@ralfj.de>2024-05-30 09:05:03 +0200
commitdaeb68a579d0a0e8e3de0d1cd39c60c2d0a30a87 (patch)
treeebc9bed11eeedb7301c32cb9e3db15b5c9a1c865
parenta200d38ce9786cc12da7cf2087b20ee0e475807e (diff)
downloadrust-daeb68a579d0a0e8e3de0d1cd39c60c2d0a30a87.tar.gz
rust-daeb68a579d0a0e8e3de0d1cd39c60c2d0a30a87.zip
make env/var test deterministic
-rw-r--r--src/tools/miri/tests/pass/shims/env/var.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/miri/tests/pass/shims/env/var.rs b/src/tools/miri/tests/pass/shims/env/var.rs
index babaf00578a..a576c1fc8bb 100644
--- a/src/tools/miri/tests/pass/shims/env/var.rs
+++ b/src/tools/miri/tests/pass/shims/env/var.rs
@@ -1,3 +1,4 @@
+//@compile-flags: -Zmiri-preemption-rate=0
 use std::env;
 use std::thread;
 
@@ -26,6 +27,8 @@ fn main() {
     println!("{:#?}", env::vars().collect::<Vec<_>>());
 
     // Do things concurrently, to make sure there's no data race.
+    // We disable preemption to make sure the lock is not contended;
+    // that means we don't hit e.g. the futex codepath on Android (which we don't support).
     let t = thread::spawn(|| {
         env::set_var("MIRI_TEST", "42");
     });