Skip to content

Commit 1ec6779

Browse files
RalfJunglcnr
authored andcommitted
make env/var test deterministic
1 parent 38ad909 commit 1ec6779

File tree

1 file changed

+3
-0
lines changed
  • src/tools/miri/tests/pass/shims/env

1 file changed

+3
-0
lines changed

src/tools/miri/tests/pass/shims/env/var.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@compile-flags: -Zmiri-preemption-rate=0
12
use std::env;
23
use std::thread;
34

@@ -26,6 +27,8 @@ fn main() {
2627
println!("{:#?}", env::vars().collect::<Vec<_>>());
2728

2829
// Do things concurrently, to make sure there's no data race.
30+
// We disable preemption to make sure the lock is not contended;
31+
// that means we don't hit e.g. the futex codepath on Android (which we don't support).
2932
let t = thread::spawn(|| {
3033
env::set_var("MIRI_TEST", "42");
3134
});

0 commit comments

Comments
 (0)