From 54c65051919df8f79ef80a33edece1e21587e039 Mon Sep 17 00:00:00 2001 From: mahmatias Date: Mon, 19 Oct 2026 10:56:13 -0300 Subject: [PATCH] test(slideshow): drop the template cache after the hand-written bad files The folder's mtime may not move from the save's listing to the list that follows (same clock tick on a fast machine), so the stale cache hid the bad files and problems came back empty - deterministic on a warm build. The test drops the cache as its own wild.json case already did (and as templates_changed documents). --- crates/engine/src/tests_slide_template.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/engine/src/tests_slide_template.rs b/crates/engine/src/tests_slide_template.rs index f7a899c43..9d3e9c807 100644 --- a/crates/engine/src/tests_slide_template.rs +++ b/crates/engine/src/tests_slide_template.rs @@ -248,6 +248,9 @@ fn bad_files_are_reported_and_skipped() { } std::fs::create_dir_all(folder.join("folder.json")).unwrap(); std::fs::write(folder.join("notes.txt"), b"ignored").unwrap(); + // written by hand, not through LightCraft: the folder's time may not have moved since the + // save's listing (same clock tick), so the cached listing is dropped as a write would drop it + s.slide_templates_cache = None; let r = run(&mut s, "slideshow.templates.list", json!({})); let user: Vec<_> = r["templates"].as_array().unwrap().iter().filter(|t| t["builtin"] == false).collect(); assert_eq!(user.len(), 1, "only the good one: {r}");