mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-02 14:17:19 +00:00
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.
This commit is contained in:
@@ -798,8 +798,14 @@ func TestDiskAwareECRebalancing(t *testing.T) {
|
||||
err := lockCmd.Do([]string{}, commandEnv, &lockOutput)
|
||||
if err != nil {
|
||||
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
|
||||
var output bytes.Buffer
|
||||
ecEncodeCmd := shell.Commands[findCommandIndex("ec.encode")]
|
||||
|
||||
Reference in New Issue
Block a user