mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Pace the unwatch regression test so it is not flaky (AI-assisted)
A burst of 200 operations within milliseconds sometimes made macOS coalesce events into a rescan, which notify 4 does not deliver, failing the test about 4 times in 10 even with the fix. With a 5 ms pause per iteration the fixed code passed 20 of 20 runs; the unfixed code still loses about a third of the creations (60-67 of 100).
This commit is contained in:
parent
75c19ddb6a
commit
10bc251d7f
1 changed files with 3 additions and 0 deletions
|
|
@ -173,6 +173,9 @@ mod test {
|
|||
fs::remove_file(&removed).unwrap();
|
||||
let _ = backend.unwatch(&removed);
|
||||
fs::write(new.join(format!("{i}.txt")), "").unwrap();
|
||||
// Paced so the OS does not coalesce the burst into a rescan, which notify 4 drops on
|
||||
// its own; this test is about the events unwatch loses.
|
||||
thread::sleep(Duration::from_millis(5));
|
||||
}
|
||||
|
||||
let mut created = HashSet::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue