Change summary
fsevent/src/lib.rs | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
Detailed changes
@@ -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]