Summary
TestClear covers Clear only single-threaded. A consumer calling Clear concurrently with Store/Load/Range (cache-flush-on-reload patterns) has no safety evidence.
Scope
Analogous to existing TestRangeDuringWrites / TestDeleteDuringRange:
TestClearDuringWrites — 16 goroutines storing while one goroutine periodically Clears; assert no panic, -race clean, goleak clean.
TestClearDuringRange — one ranger running while Clear fires; assert no panic, observed keys bounded, duplicate visits impossible.
Acceptance criteria
- Both tests stable over
go test -race -count=10 ./....
- Coverage unchanged (100%).
Source: test-analyst agent.
Summary
TestClearcovers Clear only single-threaded. A consumer calling Clear concurrently with Store/Load/Range (cache-flush-on-reload patterns) has no safety evidence.Scope
Analogous to existing
TestRangeDuringWrites/TestDeleteDuringRange:TestClearDuringWrites— 16 goroutines storing while one goroutine periodically Clears; assert no panic,-raceclean,goleakclean.TestClearDuringRange— one ranger running while Clear fires; assert no panic, observed keys bounded, duplicate visits impossible.Acceptance criteria
go test -race -count=10 ./....Source: test-analyst agent.