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

Commit 57d1f2b

Browse files
tomakaniklasad1
authored andcommitted
Fix the mio test again (#8602)
1 parent 1fa95ac commit 57d1f2b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

util/io/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ mod tests {
186186
use std::time::Duration;
187187
use super::*;
188188

189+
// Mio's behaviour is too unstable for this test. Sometimes we have to wait a few milliseconds,
190+
// sometimes more than 5 seconds for the message to arrive.
191+
// Therefore we ignore this test in order to not have spurious failure when running continuous
192+
// integration.
189193
#[test]
194+
#[cfg_attr(feature = "mio", ignore)]
190195
fn send_message_to_handler() {
191196
struct MyHandler(atomic::AtomicBool);
192197

@@ -209,7 +214,7 @@ mod tests {
209214

210215
service.send_message(MyMessage { data: 5 }).unwrap();
211216

212-
thread::sleep(Duration::from_secs(5));
217+
thread::sleep(Duration::from_secs(1));
213218
assert!(handler.0.load(atomic::Ordering::SeqCst));
214219
}
215220

0 commit comments

Comments
 (0)