From 35ea0d45fc7c716799da9e625a5b8710404ddc30 Mon Sep 17 00:00:00 2001 From: soul-probe Date: Wed, 30 Sep 2026 13:39:47 +0200 Subject: [PATCH] Odin test: with nothing to write, the write step reads nothing, not even the lease The flush step is due on every pass until something changes. Hand mutant M5b (the daemon skipping its own dirty check) left every write rule intact but read the lease file on every 2 ms pass; no test saw it. Co-Authored-By: Claude Opus 5.5 --- crates/odin-daemon/src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/odin-daemon/src/main.rs b/crates/odin-daemon/src/main.rs index 0615c3d..b19eb48 100644 --- a/crates/odin-daemon/src/main.rs +++ b/crates/odin-daemon/src/main.rs @@ -3019,7 +3019,9 @@ mod tests { } /// An interval in which nothing changed writes nothing, however often the - /// write is due. + /// write is due. With nothing to write the write step reads nothing + /// either, not even the lease: it is due on every pass until something + /// changes. #[test] fn nothing_changed_is_no_write() -> Result<()> { let mut odin = activated_odin()?; @@ -3032,6 +3034,13 @@ mod tests { odin.pass()?; } assert_eq!(file_identity(&odin.store)?, written); + + std::fs::write(&odin.lease_path, b"not a cultcache store")?; + odin.timers.last_projection_refresh = Some(Instant::now()); + odin.timers.last_heartbeat = Some(Instant::now()); + odin.timers.last_flush = None; + odin.pass()?; + assert_eq!(file_identity(&odin.store)?, written); Ok(()) }