From 57d1f2b4d35d79a69aabe4d4460463a8e2569ad3 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 11 May 2018 13:45:07 +0200 Subject: [PATCH] Fix the mio test again (#8602) --- util/io/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/io/src/lib.rs b/util/io/src/lib.rs index ef8c3adc7..cd635121f 100644 --- a/util/io/src/lib.rs +++ b/util/io/src/lib.rs @@ -186,7 +186,12 @@ mod tests { use std::time::Duration; use super::*; + // Mio's behaviour is too unstable for this test. Sometimes we have to wait a few milliseconds, + // sometimes more than 5 seconds for the message to arrive. + // Therefore we ignore this test in order to not have spurious failure when running continuous + // integration. #[test] + #[cfg_attr(feature = "mio", ignore)] fn send_message_to_handler() { struct MyHandler(atomic::AtomicBool); @@ -209,7 +214,7 @@ mod tests { service.send_message(MyMessage { data: 5 }).unwrap(); - thread::sleep(Duration::from_secs(5)); + thread::sleep(Duration::from_secs(1)); assert!(handler.0.load(atomic::Ordering::SeqCst)); }