mirror of
https://github.com/pgsty/minio.git
synced 2026-11-09 17:21:51 +03:00
test(heal): set the parity the drive heal tests rebuild from
Earlier tests can leave a storage class of parity 0 behind (newTestConfig on a single drive), and a version written without parity cannot be rebuilt on the drive the tests heal. Set the parity of the test pools' sets for the duration of each drive heal test, as other tests that depend on parity do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/minio/minio/internal/bucket/versioning"
|
||||
"github.com/minio/minio/internal/config/storageclass"
|
||||
)
|
||||
|
||||
// Drive heal evaluates lifecycle on the versions of one pool and enqueues
|
||||
@@ -31,8 +32,13 @@ import (
|
||||
|
||||
// startTestBackgroundHeal registers the background heal sequence and a heal
|
||||
// worker, which drive healing needs for its bucket heals.
|
||||
func startTestBackgroundHeal(t *testing.T, z ObjectLayer) {
|
||||
func startTestBackgroundHeal(t *testing.T, z *erasureServerPools) {
|
||||
t.Helper()
|
||||
// The healed drive is rebuilt from parity. Earlier tests can leave a
|
||||
// storage class of parity 0 behind (newTestConfig on a single drive).
|
||||
previous := globalStorageClass
|
||||
globalStorageClass.Update(storageclass.Config{Standard: storageclass.StorageClass{Parity: z.serverPools[0].setDriveCount / 2}})
|
||||
t.Cleanup(func() { globalStorageClass.Update(previous) })
|
||||
if globalBackgroundHealState == nil {
|
||||
globalBackgroundHealState = newHealState(GlobalContext, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user