From dd80b1aaba5ae373f22de2318562108d0177aa11 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 20 Sep 2022 09:14:14 +0200 Subject: [PATCH] work harder around notorious macos unrealiability --- tests/pass/concurrency/sync.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/pass/concurrency/sync.rs b/tests/pass/concurrency/sync.rs index 16bdc03f1092..7835d9747de0 100644 --- a/tests/pass/concurrency/sync.rs +++ b/tests/pass/concurrency/sync.rs @@ -81,7 +81,9 @@ fn check_conditional_variables_timed_wait_notimeout() { cvar.notify_one(); }); - let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(1000)).unwrap(); + // macOS runners are very unreliable. + let timeout = if cfg!(target_os = "macos") { 2000 } else { 500 }; + let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(timeout)).unwrap(); assert!(!timeout.timed_out()); handle.join().unwrap(); }