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 <noreply@anthropic.com>
This commit is contained in:
parent
8189623411
commit
35ea0d45fc
1 changed files with 10 additions and 1 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue