]> git.lizzy.rs Git - rust.git/commitdiff
rustup, and adjust timing tests
authorRalf Jung <post@ralfj.de>
Wed, 3 Jun 2020 07:40:21 +0000 (09:40 +0200)
committerRalf Jung <post@ralfj.de>
Wed, 3 Jun 2020 07:40:21 +0000 (09:40 +0200)
rust-version
tests/run-pass/concurrency/libc_pthread_cond.rs
tests/run-pass/concurrency/sync.rs

index daae7a34d048269881f9bc8b969751a8d48d11c2..d163c31622820c74d87f8ea32a451845a24a52fb 100644 (file)
@@ -1 +1 @@
-d3cba254e464303a6495942f3a831c2bbd7f1768
+680a4b2fbdca0dc6c5ceec826a8dbeabe28f305d
index 27f5ead450fab10f3cdbd029f3a90cfe557ee481..8aa3b210f4b0f6856f06ff2ec396fd09adc2e264 100644 (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);
index e36c79491f91e691806bf05a833f255e803c9edb..b36ad27ebe198226e310d6314164c8fec6ade272 100644 (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();
 }