mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
fix: possible race in FS local lockMap (#9598)
This commit is contained in:
@@ -57,6 +57,7 @@ import (
|
||||
"github.com/minio/minio-go/v6/pkg/s3utils"
|
||||
"github.com/minio/minio-go/v6/pkg/signer"
|
||||
"github.com/minio/minio/cmd/config"
|
||||
"github.com/minio/minio/cmd/crypto"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
"github.com/minio/minio/pkg/auth"
|
||||
"github.com/minio/minio/pkg/bucket/policy"
|
||||
@@ -65,6 +66,18 @@ import (
|
||||
|
||||
// Tests should initNSLock only once.
|
||||
func init() {
|
||||
// disable ENVs which interfere with tests.
|
||||
for _, env := range []string{
|
||||
crypto.EnvAutoEncryptionLegacy,
|
||||
crypto.EnvKMSAutoEncryption,
|
||||
config.EnvAccessKey,
|
||||
config.EnvAccessKeyOld,
|
||||
config.EnvSecretKey,
|
||||
config.EnvSecretKeyOld,
|
||||
} {
|
||||
os.Unsetenv(env)
|
||||
}
|
||||
|
||||
// Set as non-distributed.
|
||||
globalIsDistXL = false
|
||||
|
||||
@@ -342,27 +355,9 @@ func UnstartedTestServer(t TestErrHandler, instanceType string) TestServer {
|
||||
globalMinioPort = port
|
||||
globalMinioAddr = getEndpointsLocalAddr(testServer.Disks)
|
||||
|
||||
globalConfigSys = NewConfigSys()
|
||||
newAllSubsystems()
|
||||
|
||||
globalIAMSys = NewIAMSys()
|
||||
globalIAMSys.Init(ctx, objLayer)
|
||||
|
||||
buckets, err := objLayer.ListBuckets(ctx)
|
||||
if err != nil {
|
||||
t.Fatalf("Unable to list buckets on backend %s", err)
|
||||
}
|
||||
|
||||
globalPolicySys = NewPolicySys()
|
||||
globalPolicySys.Init(buckets, objLayer)
|
||||
|
||||
globalNotificationSys = NewNotificationSys(testServer.Disks)
|
||||
globalNotificationSys.Init(buckets, objLayer)
|
||||
|
||||
globalLifecycleSys = NewLifecycleSys()
|
||||
globalLifecycleSys.Init(buckets, objLayer)
|
||||
|
||||
globalBucketSSEConfigSys = NewBucketSSEConfigSys()
|
||||
globalBucketSSEConfigSys.Init(buckets, objLayer)
|
||||
initAllSubsystems(objLayer)
|
||||
|
||||
return testServer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user