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 {...@@ -1849,15 +1849,10 @@ mod tests {
1849 notebook::fs::rename(&folder, &away).unwrap();1849 notebook::fs::rename(&folder, &away).unwrap();
1850 let back = std::thread::spawn({1850 let back = std::thread::spawn({
1851 let (folder, away) = (folder.clone(), away.clone());1851 let (folder, away) = (folder.clone(), away.clone());
1852 move || {1852 move || notebook::fs::rename(away, folder).unwrap()
1853 std::thread::sleep(std::time::Duration::from_millis(100));
1854 notebook::fs::rename(away, folder).unwrap();
1855 }
1856 });1853 });
1857 assert!(!super::vanished(1854 // The wait the app gives a missed folder, however loaded the machine running the test.
1858 &folder,1855 assert!(!super::vanished(&folder, super::VANISH));
1859 std::time::Duration::from_millis(600)
1860 ));
1861 back.join().unwrap();1856 back.join().unwrap();
1862 notebook::fs::remove_dir_all(&folder).unwrap();1857 notebook::fs::remove_dir_all(&folder).unwrap();
1863 assert!(super::vanished(&folder, std::time::Duration::ZERO));1858 assert!(super::vanished(&folder, std::time::Duration::ZERO));