Skip to content

Commit ea4a4f7

Browse files
committed
tests/pass/concurrency/sync: try to make it less likely for the test to fail on macOS
1 parent 28abd3f commit ea4a4f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/pass/concurrency/sync.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ fn check_conditional_variables_timed_wait_timeout() {
6363
let cvar = Condvar::new();
6464
let guard = lock.lock().unwrap();
6565
let now = Instant::now();
66-
let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(100)).unwrap();
66+
let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(10)).unwrap();
6767
assert!(timeout.timed_out());
6868
let elapsed_time = now.elapsed().as_millis();
69-
assert!(100 <= elapsed_time && elapsed_time <= 1000);
69+
assert!(10 <= elapsed_time && elapsed_time <= 1000);
7070
}
7171

7272
/// Test that signaling a conditional variable when waiting with a timeout works
@@ -79,7 +79,7 @@ fn check_conditional_variables_timed_wait_notimeout() {
7979
let guard = lock.lock().unwrap();
8080

8181
let handle = thread::spawn(move || {
82-
thread::sleep(Duration::from_millis(100)); // Make sure the other thread is waiting by the time we call `notify`.
82+
thread::sleep(Duration::from_millis(1)); // Make sure the other thread is waiting by the time we call `notify`.
8383
let (_lock, cvar) = &*pair2;
8484
cvar.notify_one();
8585
});

0 commit comments

Comments
 (0)