Browse Source

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) <noreply@anthropic.com>
feature/sw-block
pingqiu 4 days ago
parent
commit
4ed54d04ba
  1. 3
      weed/storage/blockvol/sync_all_protocol_test.go

3
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")

Loading…
Cancel
Save