Auto merge of #1444 - RalfJung:rustup, r=RalfJung

rustup, and adjust timing tests

I saw a timing failure on macOS, so leave some more slack space.
This commit is contained in:
bors 2020-06-03 07:41:37 +00:00
commit 592d621b78
3 changed files with 4 additions and 2 deletions

View File

@ -1 +1 @@
d3cba254e464303a6495942f3a831c2bbd7f1768
680a4b2fbdca0dc6c5ceec826a8dbeabe28f305d

View File

@ -25,6 +25,8 @@ fn test_timed_wait_timeout(clock_id: i32) {
let mut now: libc::timespec = mem::zeroed();
assert_eq!(libc::clock_gettime(clock_id, &mut now), 0);
// Waiting for a second... mostly because waiting less requires mich more tricky arithmetic.
// FIXME: wait less.
let timeout = libc::timespec { tv_sec: now.tv_sec + 1, tv_nsec: now.tv_nsec };
assert_eq!(libc::pthread_mutex_lock(&mut mutex as *mut _), 0);

View File

@ -109,7 +109,7 @@ fn check_conditional_variables_timed_wait_notimeout() {
cvar.notify_one();
});
let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(100)).unwrap();
let (_guard, timeout) = cvar.wait_timeout(guard, Duration::from_millis(200)).unwrap();
assert!(!timeout.timed_out());
handle.join().unwrap();
}