Fix the mio test again (#8602)

This commit is contained in:
Pierre Krieger 2018-05-11 13:45:07 +02:00 committed by Niklas Adolfsson
parent 1fa95ac236
commit 57d1f2b4d3

View File

@ -186,7 +186,12 @@ mod tests {
use std::time::Duration; use std::time::Duration;
use super::*; 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] #[test]
#[cfg_attr(feature = "mio", ignore)]
fn send_message_to_handler() { fn send_message_to_handler() {
struct MyHandler(atomic::AtomicBool); struct MyHandler(atomic::AtomicBool);
@ -209,7 +214,7 @@ mod tests {
service.send_message(MyMessage { data: 5 }).unwrap(); 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)); assert!(handler.0.load(atomic::Ordering::SeqCst));
} }