mirror of
https://github.com/pgsty/minio.git
synced 2026-10-09 11:15:57 +03:00
fix racy tests when editing xl.getDisks (#8879)
This commit is contained in:
committed by
kannappanr
parent
b9c48e0ab0
commit
1ffbb5c24c
@@ -270,6 +270,7 @@ func TestHealObjectXL(t *testing.T) {
|
||||
}
|
||||
|
||||
xlDisks := xl.getDisks()
|
||||
z.zones[0].xlDisksMu.Lock()
|
||||
xl.getDisks = func() []StorageAPI {
|
||||
// Nil more than half the disks, to remove write quorum.
|
||||
for i := 0; i <= len(xlDisks)/2; i++ {
|
||||
@@ -277,6 +278,7 @@ func TestHealObjectXL(t *testing.T) {
|
||||
}
|
||||
return xlDisks
|
||||
}
|
||||
z.zones[0].xlDisksMu.Unlock()
|
||||
|
||||
// Try healing now, expect to receive errDiskNotFound.
|
||||
_, err = obj.HealObject(context.Background(), bucket, object, false, false, madmin.HealDeepScan)
|
||||
|
||||
Reference in New Issue
Block a user