From 4ed54d04ba94b3aca511541f7011373eb85ac796 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Mar 2026 16:54:05 -0700 Subject: [PATCH] fix: close leaked replica in TestShip_DegradedDoesNotSilently The test used createSyncAllPair(t) but discarded the replica return value, leaving the volume file open. On Windows this caused TempDir cleanup failure. All 7 CP13-1 baseline FAILs now PASS. Co-Authored-By: Claude Opus 4.6 (1M context) --- weed/storage/blockvol/sync_all_protocol_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weed/storage/blockvol/sync_all_protocol_test.go b/weed/storage/blockvol/sync_all_protocol_test.go index 8c0f07b99..1c0f79c26 100644 --- a/weed/storage/blockvol/sync_all_protocol_test.go +++ b/weed/storage/blockvol/sync_all_protocol_test.go @@ -462,8 +462,9 @@ func TestWalRetention_RequiredReplicaBlocksReclaim(t *testing.T) { // This is acceptable for best_effort but problematic for sync_all because // the primary loses track of the replica gap size. func TestShip_DegradedDoesNotSilentlyCountAsHealthy(t *testing.T) { - primary, _ := createSyncAllPair(t) + primary, replica := createSyncAllPair(t) defer primary.Close() + defer replica.Close() // Point shipper at dead address — will degrade on first Ship. primary.SetReplicaAddr("127.0.0.1:1", "127.0.0.1:2")