Browse Source

test: fix missing unlock in ec_encode_with_disk_awareness

Add defer unlock pattern to ensure lock is always released, matching
the pattern used in other subtests.
pull/7607/head
chrislusf 2 months ago
parent
commit
cacfcf5eb2
  1. 6
      test/erasure_coding/ec_integration_test.go

6
test/erasure_coding/ec_integration_test.go

@ -798,8 +798,14 @@ func TestDiskAwareECRebalancing(t *testing.T) {
err := lockCmd.Do([]string{}, commandEnv, &lockOutput) err := lockCmd.Do([]string{}, commandEnv, &lockOutput)
if err != nil { if err != nil {
t.Logf("Lock command failed: %v", err) t.Logf("Lock command failed: %v", err)
return
} }
// Defer unlock to ensure it's always released
unlockCmd := shell.Commands[findCommandIndex("unlock")]
var unlockOutput bytes.Buffer
defer unlockCmd.Do([]string{}, commandEnv, &unlockOutput)
// Execute EC encoding // Execute EC encoding
var output bytes.Buffer var output bytes.Buffer
ecEncodeCmd := shell.Commands[findCommandIndex("ec.encode")] ecEncodeCmd := shell.Commands[findCommandIndex("ec.encode")]

Loading…
Cancel
Save