mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 22:16:15 +03:00
Added unit-tests for treeWalkPool (#1969)
* Added unit-tests for treeWalkPool * Added unit tests for tree-walk-fs * Added period at the end of all comments. * FS/XL: Unified tree walk tests for both backends * Added disk failure related tests for treewalk Replaced removeRandomDisks with removeDiskN. There is no need to randomize disks that fail while the distribution of chunks in XL during erasure coding data is random.
This commit is contained in:
committed by
Harshavardhana
parent
59366d8f4c
commit
b6b9e88e47
+7
-5
@@ -546,11 +546,13 @@ func removeRoots(roots []string) {
|
||||
}
|
||||
}
|
||||
|
||||
// removeRandomDisk - removes a count of random disks from a disk slice.
|
||||
func removeRandomDisk(disks []string, removeCount int) {
|
||||
ints := randInts(len(disks))
|
||||
for _, i := range ints[:removeCount] {
|
||||
removeAll(disks[i-1])
|
||||
//removeDiskN - removes N disks from supplied disk slice.
|
||||
func removeDiskN(disks []string, n int) {
|
||||
if n > len(disks) {
|
||||
n = len(disks)
|
||||
}
|
||||
for _, disk := range disks[:n] {
|
||||
removeAll(disk)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user