Tweak durations in fsevent unit test to reduce odds of timeout

This commit is contained in:
Max Brunsfeld 2021-04-29 12:52:28 -07:00
parent 3d6336b12a
commit c867cfa917

View file

@ -345,12 +345,12 @@ mod tests {
// Delay the call to `run` in order to make sure we don't miss any events that occur
// between creating the `EventStream` and calling `run`.
thread::spawn(move || {
thread::sleep(Duration::from_millis(250));
thread::sleep(Duration::from_millis(100));
stream.run(move |events| tx.send(events.to_vec()).is_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_millis(800)).unwrap();
let event = events.last().unwrap();
assert_eq!(event.path, path.join("new-file"));
assert!(event.flags.contains(StreamFlags::ITEM_CREATED));