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:
Feng Ruohang
2026-11-06 19:29:22 +08:00
parent 1780eb8ffc
commit 1eee720f74
+7 -1
View File
@@ -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)
}