authoravatarclover caruso<git@paperclover.net>2026-10-19 21:49:24-07:00
committeravatarclover caruso<git@paperclover.net>2026-10-19 23:39:58-07:00
log513df158d4d03ab227320f5d92fa75722135d7f5
tree6a4f4041c53ab2e5577849849ccacfb02f9d8603
parent8bdc63d4fcfde20f31903404a9ea024f87f8a8fd
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

test(desktop): give a folder missing for a moment the app's own wait

a_folder_missing_for_a_moment_is_not_gone moved the folder back from a thread that slept 100 ms first, and checked it after 600 ms: on a loaded machine the thread could run later than that, and the folder counted as gone. The folder now moves back at once, and is checked after VANISH, the 3 s the app itself waits, so only a machine that stalls a thread for seconds fails it. Assisted-by: claude-opus-5.5

1 files changed, 3 insertions(+), 8 deletions(-)

crates/snowbound/src/manage.rs+3-8
......@@ -1849,15 +1849,10 @@ mod tests {
18491849 notebook::fs::rename(&folder, &away).unwrap();
18501850 let back = std::thread::spawn({
18511851 let (folder, away) = (folder.clone(), away.clone());
1852 move || {
1853 std::thread::sleep(std::time::Duration::from_millis(100));
1854 notebook::fs::rename(away, folder).unwrap();
1855 }
1852 move || notebook::fs::rename(away, folder).unwrap()
18561853 });
1857 assert!(!super::vanished(
1858 &folder,
1859 std::time::Duration::from_millis(600)
1860 ));
1854 // The wait the app gives a missed folder, however loaded the machine running the test.
1855 assert!(!super::vanished(&folder, super::VANISH));
18611856 back.join().unwrap();
18621857 notebook::fs::remove_dir_all(&folder).unwrap();
18631858 assert!(super::vanished(&folder, std::time::Duration::ZERO));