Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix the mio test again #8602

Merged
merged 1 commit into from
May 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion util/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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));
}

Expand Down