about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2015-01-19 09:11:06 -0800
committerSteven Fackler <sfackler@gmail.com>2015-01-19 09:11:06 -0800
commit2854f0c75e40361a27f200a80612a8a357335843 (patch)
treecf6e4f5769aaac407ac6bb43f5a9a27cfc26adf0 /src/libstd/sync
parent43f2c199e4e87d7ccd15658c52ad8dc5a1d54fb9 (diff)
downloadrust-2854f0c75e40361a27f200a80612a8a357335843.tar.gz
rust-2854f0c75e40361a27f200a80612a8a357335843.zip
Fix flaky condvar test
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/condvar.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs
index a81a4504323..d2d5335078e 100644
--- a/src/libstd/sync/condvar.rs
+++ b/src/libstd/sync/condvar.rs
@@ -420,14 +420,15 @@ mod tests {
         static M: StaticMutex = MUTEX_INIT;
 
         let g = M.lock().unwrap();
-        let (g, success) = C.wait_timeout(g, Duration::nanoseconds(1000)).unwrap();
-        assert!(!success);
+        let (g, _no_timeout) = C.wait_timeout(g, Duration::nanoseconds(1000)).unwrap();
+        // spurious wakeups mean this isn't necessarily true
+        // assert!(!no_timeout);
         let _t = Thread::spawn(move || {
             let _g = M.lock().unwrap();
             C.notify_one();
         });
-        let (g, success) = C.wait_timeout(g, Duration::days(1)).unwrap();
-        assert!(success);
+        let (g, no_timeout) = C.wait_timeout(g, Duration::days(1)).unwrap();
+        assert!(no_timeout);
         drop(g);
         unsafe { C.destroy(); M.destroy(); }
     }