From 77ad2fc12b4d1dd5424c612d52955e15390b7d68 Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Thu, 5 Nov 2026 09:26:32 +0800 Subject: [PATCH] test(batch): pin the parity of the drive-revision purge test TestBatchExpirePurgeAuthorizesDriveRevisions writes a failed tag revision to one drive of sixteen and needs the read quorum of the metadata to stay below sixteen. Tests that run newTestConfig on a single-drive layer, such as TestIsReqAuthenticated, leave a storage class of parity 0 behind, which resetTestGlobals does not restore. With parity 0 the quorum history of the key is unreadable, the purge correctly refuses, and the test failed in the full ./cmd run while passing alone. Set the default parity for the test, as other erasure tests do, and restore it afterwards. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Feng Ruohang --- cmd/batch-expire-purge-authz_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/batch-expire-purge-authz_test.go b/cmd/batch-expire-purge-authz_test.go index 259f725d9..6c8b14dfd 100644 --- a/cmd/batch-expire-purge-authz_test.go +++ b/cmd/batch-expire-purge-authz_test.go @@ -15,6 +15,7 @@ import ( "time" "github.com/minio/minio/internal/auth" + "github.com/minio/minio/internal/config/storageclass" xhttp "github.com/minio/minio/internal/http" "github.com/pgsty/silo-pkg/v3/policy" ) @@ -373,6 +374,12 @@ func (d batchTagWriteFault) UpdateMetadata(ctx context.Context, bucket, object s func TestBatchExpirePurgeAuthorizesDriveRevisions(t *testing.T) { resetTestGlobals() t.Cleanup(resetTestGlobals) + // One drive of sixteen holds the failed tag write, so the read quorum of + // the metadata must stay below sixteen. 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: 4}}) + t.Cleanup(func() { globalStorageClass.Update(previous) }) z := purgeSinglePool(t, 16) globalIAMSys.initStore(z, nil) mustIAM(t, globalIAMSys.Load(t.Context(), true))