From 1cf5413173888fbb24b51120dfbf2dd4c1ccf74a Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 19 May 2021 15:01:11 +0200 Subject: [PATCH] Increase timeout to 2s for fsevents tests --- fsevent/src/lib.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/fsevent/src/lib.rs b/fsevent/src/lib.rs index 44af8f1ba61bb04e1914a3d40ce4b6541c36c783..e6f8bcfe45450e997ac157965a60c905b1222552 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]