From 513df158d4d03ab227320f5d92fa75722135d7f5 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Mon, 19 Oct 2026 21:49:24 -0700 Subject: [PATCH] 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 --- crates/snowbound/src/manage.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/snowbound/src/manage.rs b/crates/snowbound/src/manage.rs index c9ccfc459c9e2dc726bbbc44ed4b7edbb00a38bf..b965b06a53a9cdb93768b72f617b8d5763407eff 100644 --- a/crates/snowbound/src/manage.rs +++ b/crates/snowbound/src/manage.rs @@ -1849,15 +1849,10 @@ mod tests { notebook::fs::rename(&folder, &away).unwrap(); let back = std::thread::spawn({ let (folder, away) = (folder.clone(), away.clone()); - move || { - std::thread::sleep(std::time::Duration::from_millis(100)); - notebook::fs::rename(away, folder).unwrap(); - } + move || notebook::fs::rename(away, folder).unwrap() }); - assert!(!super::vanished( - &folder, - std::time::Duration::from_millis(600) - )); + // The wait the app gives a missed folder, however loaded the machine running the test. + assert!(!super::vanished(&folder, super::VANISH)); back.join().unwrap(); notebook::fs::remove_dir_all(&folder).unwrap(); assert!(super::vanished(&folder, std::time::Duration::ZERO)); -- 2.54.1