From 1eee720f74ddaa345217caaca4acbf9042b85807 Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Fri, 6 Nov 2026 19:29:22 +0800 Subject: [PATCH] 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 Signed-off-by: Feng Ruohang --- cmd/global-heal-lifecycle_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/global-heal-lifecycle_test.go b/cmd/global-heal-lifecycle_test.go index eda2df5d4..05fca264f 100644 --- a/cmd/global-heal-lifecycle_test.go +++ b/cmd/global-heal-lifecycle_test.go @@ -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) }