storage: read the COW window entry under its lock in a held-fill test (#975)

Interim merge note (spec trace workflow startup_failure since 22:45Z): test-only fix. go test (linux) and process-level tests (real binaries) passed on 274872a6; spec-trace-check.sh and public-text-check.sh run locally with the base branch's scripts: both pass. Race evidence on a Linux host: go test -race -count=50 of TestCutCOWV3_HeldFillIsCancelledByAbortAndDrained reports one data race and a concurrent map fatal on main a6304c21, and none on 274872a6. Code review ACCEPT on 274872a6.
This commit is contained in:
pingqiu-cpu authored and GitHub committed 2026-12-02 22:13:24 -08:00
1 parent 8c9358bca0
commit 9d61cd13dd
1 file changed
+5
@@ -51,7 +51,12 @@ func TestCutCOWV3_HeldFillIsCancelledByAbortAndDrained(t *testing.T) {
if w == nil {
t.Fatal("missing active window")
}
w.mu.Lock() // the copier adds entries under the window's lock
e := w.entries[2]
w.mu.Unlock()
if e == nil {
t.Fatal("no window entry for chunk 2")
}
e.mu.Lock()
state := e.state
e.mu.Unlock()