Add fault-injection tests for interruption and corruption (closes #72) #173

Open
clawbot wants to merge 1 commits from issue-72-fault-injection into next
1 Commits
Author SHA1 Message Date
sneak e34f7aef99 Add fault-injection tests for interruption and corruption (closes #72)
check / check (pull_request) Failing after 0s
Introduce internal/storage/faultstore, a storage.Storer wrapper that
injects faults through the existing seam rather than patching production
code: an upload that dies partway, a backend that reports success while
storing nothing, and reads that return corrupt or truncated bytes.

Cover all six scenarios from the issue, each asserting the observable
end state (index, destination, and what the user is told), not just that
an error came back. Scenario 1b (a retry after an interrupted upload
must restore) exposed a real defect and is skipped with a pointer to
#148; scenario 2 asserts honest
reporting of a half-exported snapshot, with automatic repair also left
to that issue. No production behavior changes.

The tests run serially: each calls log.Initialize, which replaces the
global logger a concurrent backup reads, so parallel runs race under
-race — the same choice prune_count_test.go already makes.

model: claude-opus-4-8
2026-09-21 23:01:46 +00:00