Commit: 2f26d91 · Finding: TEST-05
Problem
crates/state has 190 #[test] items inline, but no crates/state/tests/ integration directory. In-module tests use in-memory doubles and cannot detect serialization drift, schema-migration bugs, or partial-write recovery. The absence of tests/ also means the public API of willow-state is never exercised against the real storage backend, nor across restart() boundaries.
There is no end-to-end "state + storage survives crash" test anywhere in the workspace.
Fix
Add crates/state/tests/persistence.rs driving the public API against the real storage backend:
- Normal write → reopen → read round-trip.
- Mid-write kill (use
tempfile + crash-simulating writer) → reopen → re-apply pending events.
- Schema migration bump scenarios.
Obvious? Moderate — the setup is mechanical but writing the crash-simulator takes care.
Commit:
2f26d91· Finding:TEST-05Problem
crates/statehas 190#[test]items inline, but nocrates/state/tests/integration directory. In-module tests use in-memory doubles and cannot detect serialization drift, schema-migration bugs, or partial-write recovery. The absence oftests/also means the public API ofwillow-stateis never exercised against the realstoragebackend, nor acrossrestart()boundaries.There is no end-to-end "state + storage survives crash" test anywhere in the workspace.
Fix
Add
crates/state/tests/persistence.rsdriving the public API against the realstoragebackend:tempfile+ crash-simulating writer) → reopen → re-apply pending events.Obvious? Moderate — the setup is mechanical but writing the crash-simulator takes care.