1
Fork 0

increase timing slack for sync tests

This commit is contained in:
Ralf Jung 2023-05-08 10:05:22 +02:00
parent 3d5a516710
commit 1db8540fe6

View file

@ -201,8 +201,9 @@ fn park_timeout() {
thread::park_timeout(Duration::from_millis(200));
// Normally, waiting in park/park_timeout may spuriously wake up early, but we
// know Miri's timed synchronization primitives do not do that.
assert!((200..1000).contains(&start.elapsed().as_millis()));
// We allow much longer sleeps as well since the macOS GHA runners seem very oversubscribed
// and sometimes just pause for 1 second or more.
assert!((200..2000).contains(&start.elapsed().as_millis()));
}
fn park_unpark() {
@ -219,8 +220,9 @@ fn park_unpark() {
thread::park();
// Normally, waiting in park/park_timeout may spuriously wake up early, but we
// know Miri's timed synchronization primitives do not do that.
assert!((200..1000).contains(&start.elapsed().as_millis()));
// We allow much longer sleeps as well since the macOS GHA runners seem very oversubscribed
// and sometimes just pause for 1 second or more.
assert!((200..2000).contains(&start.elapsed().as_millis()));
t2.join().unwrap();
}