Skip to content

Commit

Permalink
work harder around notorious macos unrealiability
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 20, 2022
1 parent bacf131 commit dd80b1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/pass/concurrency/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit dd80b1a

Please sign in to comment.