storage: pass stop tests let the stop, not a release, free the held compare

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-12-01 19:40:50 -08:00
1 parent 68b822649b
commit 08562e28d4
1 file changed
+4 -6
@@ -108,7 +108,7 @@ func waitReached(t *testing.T, reached <-chan struct{}) {
func TestV11UpgradePassStopResumesAtTheCursor(t *testing.T) {
withV11Format(t)
const at = 5
reached, release := blockPassAt(t, at)
reached, _ := blockPassAt(t, at)
upgradePassTestPersistEvery = 2
s, path, f := uncleanUpgradeStore(t)
l := uncleanAttach(t, s, f)
@@ -117,8 +117,7 @@ func TestV11UpgradePassStopResumesAtTheCursor(t *testing.T) {
t.Fatalf("status while held: %+v", st)
}
closed := make(chan error, 1)
go func() { closed <- l.Close() }()
release() // chunk 5's compare ends; the pass sees the stop and returns
go func() { closed <- l.Close() }() // the stop releases the held compare: no release() can win before it
select {
case err := <-closed:
if err != nil {
@@ -210,13 +209,12 @@ func TestV11UpgradePassRewindsBelowItsCursorAfterARebuiltPage(t *testing.T) {
s, path, f := uncleanUpgradeStore(t)
var l *chunkLayerImpl
if partial {
reached, release := blockPassAt(t, 8)
reached, _ := blockPassAt(t, 8)
upgradePassTestPersistEvery = 2
l = uncleanAttach(t, s, f)
waitReached(t, reached)
closed := make(chan error, 1)
go func() { closed <- l.Close() }()
release()
go func() { closed <- l.Close() }() // the stop, not a release, lets the held compare go
if err := <-closed; err != nil {
t.Fatal(err)
}