diff --git a/fsevent/src/lib.rs b/fsevent/src/lib.rs index 44af8f1ba6..e6f8bcfe45 100644 --- a/fsevent/src/lib.rs +++ b/fsevent/src/lib.rs @@ -313,16 +313,16 @@ mod tests { thread::spawn(move || stream.run(move |events| tx.send(events.to_vec()).is_ok())); // Flush any historical events. - rx.recv_timeout(Duration::from_millis(500)).ok(); + rx.recv_timeout(Duration::from_secs(2)).ok(); fs::write(path.join("new-file"), "").unwrap(); - let events = rx.recv_timeout(Duration::from_millis(500)).unwrap(); + let events = rx.recv_timeout(Duration::from_secs(2)).unwrap(); let event = events.last().unwrap(); assert_eq!(event.path, path.join("new-file")); assert!(event.flags.contains(StreamFlags::ITEM_CREATED)); fs::remove_file(path.join("existing-file-5")).unwrap(); - let events = rx.recv_timeout(Duration::from_millis(500)).unwrap(); + let events = rx.recv_timeout(Duration::from_secs(2)).unwrap(); let event = events.last().unwrap(); assert_eq!(event.path, path.join("existing-file-5")); assert!(event.flags.contains(StreamFlags::ITEM_REMOVED)); @@ -356,7 +356,7 @@ mod tests { assert!(event.flags.contains(StreamFlags::ITEM_CREATED)); fs::remove_file(path.join("existing-file-5")).unwrap(); - let events = rx.recv_timeout(Duration::from_millis(500)).unwrap(); + let events = rx.recv_timeout(Duration::from_secs(2)).unwrap(); let event = events.last().unwrap(); assert_eq!(event.path, path.join("existing-file-5")); assert!(event.flags.contains(StreamFlags::ITEM_REMOVED)); @@ -383,17 +383,11 @@ mod tests { }); fs::write(path.join("new-file"), "").unwrap(); - assert_eq!( - rx.recv_timeout(Duration::from_millis(500)).unwrap(), - "running" - ); + assert_eq!(rx.recv_timeout(Duration::from_secs(2)).unwrap(), "running"); // Dropping the handle causes `EventStream::run` to return. drop(handle); - assert_eq!( - rx.recv_timeout(Duration::from_millis(500)).unwrap(), - "stopped" - ); + assert_eq!(rx.recv_timeout(Duration::from_secs(2)).unwrap(), "stopped"); } #[test]