about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-02-19 11:21:51 +0100
committerRalf Jung <post@ralfj.de>2024-02-19 11:25:59 +0100
commit385479c0cd5519ae2ee5c273a333c704817f5411 (patch)
tree2b568161fc2126d512031a683a3efdc4b1be43a4
parent010f029c905ffeb01ad88288b2cf50efe65b23ae (diff)
downloadrust-385479c0cd5519ae2ee5c273a333c704817f5411.tar.gz
rust-385479c0cd5519ae2ee5c273a333c704817f5411.zip
tests/pass/concurrency/sync: try to make it less likely for the test to fail on macOS
-rw-r--r--src/tools/miri/tests/pass/concurrency/sync.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/miri/tests/pass/concurrency/sync.rs b/src/tools/miri/tests/pass/concurrency/sync.rs
index 1d48e5312d4..a6c181098b7 100644
--- a/src/tools/miri/tests/pass/concurrency/sync.rs
+++ b/src/tools/miri/tests/pass/concurrency/sync.rs
@@ -63,10 +63,10 @@ fn check_conditional_variables_timed_wait_timeout() {
     let cvar = Condvar::new();
     let guard = lock.lock().unwrap();
     let now = Instant::now();
-    let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(100)).unwrap();
+    let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(10)).unwrap();
     assert!(timeout.timed_out());
     let elapsed_time = now.elapsed().as_millis();
-    assert!(100 <= elapsed_time && elapsed_time <= 1000);
+    assert!(10 <= elapsed_time && elapsed_time <= 1000);
 }
 
 /// Test that signaling a conditional variable when waiting with a timeout works
@@ -79,7 +79,7 @@ fn check_conditional_variables_timed_wait_notimeout() {
     let guard = lock.lock().unwrap();
 
     let handle = thread::spawn(move || {
-        thread::sleep(Duration::from_millis(100)); // Make sure the other thread is waiting by the time we call `notify`.
+        thread::sleep(Duration::from_millis(1)); // Make sure the other thread is waiting by the time we call `notify`.
         let (_lock, cvar) = &*pair2;
         cvar.notify_one();
     });