mirror of
https://github.com/pgsty/minio.git
synced 2026-11-11 18:15:29 +03:00
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 <noreply@anthropic.com> Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/minio/minio/internal/auth"
|
"github.com/minio/minio/internal/auth"
|
||||||
|
"github.com/minio/minio/internal/config/storageclass"
|
||||||
xhttp "github.com/minio/minio/internal/http"
|
xhttp "github.com/minio/minio/internal/http"
|
||||||
"github.com/pgsty/silo-pkg/v3/policy"
|
"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) {
|
func TestBatchExpirePurgeAuthorizesDriveRevisions(t *testing.T) {
|
||||||
resetTestGlobals()
|
resetTestGlobals()
|
||||||
t.Cleanup(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)
|
z := purgeSinglePool(t, 16)
|
||||||
globalIAMSys.initStore(z, nil)
|
globalIAMSys.initStore(z, nil)
|
||||||
mustIAM(t, globalIAMSys.Load(t.Context(), true))
|
mustIAM(t, globalIAMSys.Load(t.Context(), true))
|
||||||
|
|||||||
Reference in New Issue
Block a user