diff --git a/cmd/admin-handlers_test.go b/cmd/admin-handlers_test.go index b258d1373..248b1c5aa 100644 --- a/cmd/admin-handlers_test.go +++ b/cmd/admin-handlers_test.go @@ -74,7 +74,7 @@ func prepareAdminErasureTestBed(ctx context.Context) (*adminErasureTestBed, erro globalEndpoints = mustGetPoolEndpoints(erasureDirs...) - initAllSubsystems(ctx) + initAllSubsystems() initConfigSubsystem(ctx, objLayer) diff --git a/cmd/admin-heal-ops.go b/cmd/admin-heal-ops.go index 8663204af..04f346cc4 100644 --- a/cmd/admin-heal-ops.go +++ b/cmd/admin-heal-ops.go @@ -100,14 +100,14 @@ type allHealState struct { } // newHealState - initialize global heal state management -func newHealState(ctx context.Context, cleanup bool) *allHealState { +func newHealState(cleanup bool) *allHealState { hstate := &allHealState{ healSeqMap: make(map[string]*healSequence), healLocalDisks: make(map[Endpoint]bool), healStatus: make(map[string]healingTracker), } if cleanup { - go hstate.periodicHealSeqsClean(ctx) + go hstate.periodicHealSeqsClean(GlobalContext) } return hstate } diff --git a/cmd/auth-handler_test.go b/cmd/auth-handler_test.go index 2d8214838..f1aba829c 100644 --- a/cmd/auth-handler_test.go +++ b/cmd/auth-handler_test.go @@ -360,10 +360,7 @@ func mustNewSignedBadMD5Request(method string, urlStr string, contentLength int6 // Tests is requested authenticated function, tests replies for s3 errors. func TestIsReqAuthenticated(t *testing.T) { - ctx, cancel := context.WithCancel(GlobalContext) - defer cancel() - - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -372,7 +369,10 @@ func TestIsReqAuthenticated(t *testing.T) { t.Fatalf("unable initialize config file, %s", err) } - initAllSubsystems(ctx) + initAllSubsystems() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() initConfigSubsystem(ctx, objLayer) @@ -414,10 +414,7 @@ func TestIsReqAuthenticated(t *testing.T) { } func TestCheckAdminRequestAuthType(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -443,6 +440,7 @@ func TestCheckAdminRequestAuthType(t *testing.T) { {Request: mustNewPresignedV2Request(http.MethodGet, "http://127.0.0.1:9000", 0, nil, t), ErrCode: ErrAccessDenied}, {Request: mustNewPresignedRequest(http.MethodGet, "http://127.0.0.1:9000", 0, nil, t), ErrCode: ErrAccessDenied}, } + ctx := context.Background() for i, testCase := range testCases { if _, s3Error := checkAdminRequestAuth(ctx, testCase.Request, iampolicy.AllAdminActions, globalSite.Region); s3Error != testCase.ErrCode { t.Errorf("Test %d: Unexpected s3error returned wanted %d, got %d", i, testCase.ErrCode, s3Error) @@ -454,7 +452,7 @@ func TestValidateAdminSignature(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -464,7 +462,8 @@ func TestValidateAdminSignature(t *testing.T) { t.Fatalf("unable initialize config file, %s", err) } - initAllSubsystems(ctx) + initAllSubsystems() + initConfigSubsystem(ctx, objLayer) globalIAMSys.Init(ctx, objLayer, globalEtcdClient, 2*time.Second) diff --git a/cmd/config-current_test.go b/cmd/config-current_test.go index 7299312c3..6c2fa2526 100644 --- a/cmd/config-current_test.go +++ b/cmd/config-current_test.go @@ -26,10 +26,7 @@ import ( ) func TestServerConfig(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/config-migrate_test.go b/cmd/config-migrate_test.go index c46bc1c57..0132c198d 100644 --- a/cmd/config-migrate_test.go +++ b/cmd/config-migrate_test.go @@ -18,7 +18,6 @@ package cmd import ( - "context" "fmt" "io/ioutil" "os" @@ -29,10 +28,7 @@ import ( // Test if config v1 is purged func TestServerConfigMigrateV1(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -168,9 +164,6 @@ func TestServerConfigMigrateInexistentConfig(t *testing.T) { // Test if a config migration from v2 to v33 is successfully done func TestServerConfigMigrateV2toV33(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - rootPath, err := ioutil.TempDir(globalTestTmpDir, "minio-") if err != nil { t.Fatal(err) @@ -179,7 +172,7 @@ func TestServerConfigMigrateV2toV33(t *testing.T) { globalConfigDir = &ConfigDir{path: rootPath} - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/dynamic-timeouts_test.go b/cmd/dynamic-timeouts_test.go index 42f66c998..1cb5e16ae 100644 --- a/cmd/dynamic-timeouts_test.go +++ b/cmd/dynamic-timeouts_test.go @@ -130,6 +130,7 @@ func TestDynamicTimeoutConcurrent(t *testing.T) { go func() { defer wg.Done() for i := 0; i < 100; i++ { + timeout.LogFailure() for j := 0; j < 100; j++ { timeout.LogSuccess(time.Duration(float64(time.Second) * rng.Float64())) } diff --git a/cmd/fs-v1.go b/cmd/fs-v1.go index 72cf7a3d7..c3c5b556a 100644 --- a/cmd/fs-v1.go +++ b/cmd/fs-v1.go @@ -118,7 +118,8 @@ func initMetaVolumeFS(fsPath, fsUUID string) error { } // NewFSObjectLayer - initialize new fs object layer. -func NewFSObjectLayer(ctx context.Context, fsPath string) (ObjectLayer, error) { +func NewFSObjectLayer(fsPath string) (ObjectLayer, error) { + ctx := GlobalContext if fsPath == "" { return nil, errInvalidArgument } diff --git a/cmd/fs-v1_test.go b/cmd/fs-v1_test.go index 382dc20fa..471fff001 100644 --- a/cmd/fs-v1_test.go +++ b/cmd/fs-v1_test.go @@ -19,7 +19,6 @@ package cmd import ( "bytes" - "context" "os" "path/filepath" "testing" @@ -30,19 +29,17 @@ import ( // TestNewFS - tests initialization of all input disks // and constructs a valid `FS` object layer. func TestNewFS(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() // Do not attempt to create this path, the test validates // so that NewFSObjectLayer initializes non existing paths // and successfully returns initialized object layer. disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix()) defer os.RemoveAll(disk) - _, err := NewFSObjectLayer(ctx, "") + _, err := NewFSObjectLayer("") if err != errInvalidArgument { t.Errorf("Expecting error invalid argument, got %s", err) } - _, err = NewFSObjectLayer(ctx, disk) + _, err = NewFSObjectLayer(disk) if err != nil { errMsg := "Unable to recognize backend format, Disk is not in FS format." if err.Error() == errMsg { diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index ccea13baf..c8aed3f5f 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -300,7 +300,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) { newObject = NewGatewayLayerWithLocker(newObject) // Calls all New() for all sub-systems. - initAllSubsystems(GlobalContext) + initAllSubsystems() // Once endpoints are finalized, initialize the new object api in safe mode. globalObjLayerMutex.Lock() diff --git a/cmd/gateway-startup-msg_test.go b/cmd/gateway-startup-msg_test.go index 7e0bde1eb..a4c827937 100644 --- a/cmd/gateway-startup-msg_test.go +++ b/cmd/gateway-startup-msg_test.go @@ -18,17 +18,13 @@ package cmd import ( - "context" "os" "testing" ) // Test printing Gateway common message. func TestPrintGatewayCommonMessage(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -43,10 +39,7 @@ func TestPrintGatewayCommonMessage(t *testing.T) { // Test print gateway startup message. func TestPrintGatewayStartupMessage(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/gateway/nas/gateway-nas.go b/cmd/gateway/nas/gateway-nas.go index f41e09c2e..16c45db9a 100644 --- a/cmd/gateway/nas/gateway-nas.go +++ b/cmd/gateway/nas/gateway-nas.go @@ -87,7 +87,7 @@ func (g *NAS) Name() string { // NewGatewayLayer returns nas gatewaylayer. func (g *NAS) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error) { var err error - newObject, err := minio.NewFSObjectLayer(minio.GlobalContext, g.path) + newObject, err := minio.NewFSObjectLayer(g.path) if err != nil { return nil, err } diff --git a/cmd/handler-utils_test.go b/cmd/handler-utils_test.go index d093c9ee8..17c6bdfbc 100644 --- a/cmd/handler-utils_test.go +++ b/cmd/handler-utils_test.go @@ -34,10 +34,7 @@ import ( // Tests validate bucket LocationConstraint. func TestIsValidLocationContraint(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/jwt_test.go b/cmd/jwt_test.go index a40e7d7de..0774839f5 100644 --- a/cmd/jwt_test.go +++ b/cmd/jwt_test.go @@ -18,7 +18,6 @@ package cmd import ( - "context" "net/http" "os" "testing" @@ -30,10 +29,7 @@ import ( ) func testAuthenticate(authType string, t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -107,10 +103,7 @@ func getTokenString(accessKey, secretKey string) (string, error) { // Tests web request authenticator. func TestWebRequestAuthenticate(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -164,10 +157,7 @@ func TestWebRequestAuthenticate(t *testing.T) { } func BenchmarkParseJWTStandardClaims(b *testing.B) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { b.Fatal(err) } @@ -195,10 +185,7 @@ func BenchmarkParseJWTStandardClaims(b *testing.B) { } func BenchmarkParseJWTMapClaims(b *testing.B) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { b.Fatal(err) } @@ -228,10 +215,7 @@ func BenchmarkParseJWTMapClaims(b *testing.B) { } func BenchmarkAuthenticateNode(b *testing.B) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { b.Fatal(err) } @@ -260,10 +244,7 @@ func BenchmarkAuthenticateNode(b *testing.B) { } func BenchmarkAuthenticateWeb(b *testing.B) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { b.Fatal(err) } diff --git a/cmd/lock-rest-server-common_test.go b/cmd/lock-rest-server-common_test.go index 1ef884532..8d339da0c 100644 --- a/cmd/lock-rest-server-common_test.go +++ b/cmd/lock-rest-server-common_test.go @@ -18,7 +18,6 @@ package cmd import ( - "context" "os" "reflect" "sync" @@ -28,8 +27,8 @@ import ( ) // Helper function to create a lock server for testing -func createLockTestServer(ctx context.Context, t *testing.T) (string, *lockRESTServer, string) { - obj, fsDir, err := prepareFS(ctx) +func createLockTestServer(t *testing.T) (string, *lockRESTServer, string) { + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -53,10 +52,7 @@ func createLockTestServer(ctx context.Context, t *testing.T) (string, *lockRESTS // Test function to remove lock entries from map based on name & uid combination func TestLockRpcServerRemoveEntry(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - testPath, locker, _ := createLockTestServer(ctx, t) + testPath, locker, _ := createLockTestServer(t) defer os.RemoveAll(testPath) lockRequesterInfo1 := lockRequesterInfo{ diff --git a/cmd/object-api-listobjects_test.go b/cmd/object-api-listobjects_test.go index 13c7cbe44..46dd5f94a 100644 --- a/cmd/object-api-listobjects_test.go +++ b/cmd/object-api-listobjects_test.go @@ -1879,7 +1879,7 @@ func initFSObjectsB(disk string, t *testing.B) (obj ObjectLayer) { newTestConfig(globalMinioDefaultRegion, obj) - initAllSubsystems(GlobalContext) + initAllSubsystems() return obj } diff --git a/cmd/object-handlers_test.go b/cmd/object-handlers_test.go index a97e84ac5..c1c66cec2 100644 --- a/cmd/object-handlers_test.go +++ b/cmd/object-handlers_test.go @@ -37,7 +37,7 @@ import ( "sync" "testing" - "github.com/dustin/go-humanize" + humanize "github.com/dustin/go-humanize" "github.com/minio/minio/internal/auth" xhttp "github.com/minio/minio/internal/http" ioutilx "github.com/minio/minio/internal/ioutil" diff --git a/cmd/server-main.go b/cmd/server-main.go index f3a2e176a..47f4dee5e 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -35,7 +35,7 @@ import ( "time" "github.com/minio/cli" - "github.com/minio/minio-go/v7" + minio "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio/internal/auth" "github.com/minio/minio/internal/bucket/bandwidth" @@ -242,11 +242,11 @@ func serverHandleEnvVars() { var globalHealStateLK sync.RWMutex -func initAllSubsystems(ctx context.Context) { +func initAllSubsystems() { globalHealStateLK.Lock() // New global heal state - globalAllHealState = newHealState(ctx, true) - globalBackgroundHealState = newHealState(ctx, false) + globalAllHealState = newHealState(true) + globalBackgroundHealState = newHealState(false) globalHealStateLK.Unlock() // Create new notification system and initialize notification peer targets @@ -261,7 +261,7 @@ func initAllSubsystems(ctx context.Context) { } // Create the bucket bandwidth monitor - globalBucketMonitor = bandwidth.NewMonitor(ctx, totalNodeCount()) + globalBucketMonitor = bandwidth.NewMonitor(GlobalContext, totalNodeCount()) // Create a new config system. globalConfigSys = NewConfigSys() @@ -448,7 +448,7 @@ func serverMain(ctx *cli.Context) { initHelp() // Initialize all sub-systems - initAllSubsystems(GlobalContext) + initAllSubsystems() // Is distributed setup, error out if no certificates are found for HTTPS endpoints. if globalIsDistErasure { @@ -682,7 +682,7 @@ func newObjectLayer(ctx context.Context, endpointServerPools EndpointServerPools // For FS only, directly use the disk. if endpointServerPools.NEndpoints() == 1 { // Initialize new FS object layer. - newObject, err = NewFSObjectLayer(ctx, endpointServerPools[0].Endpoints[0].Path) + newObject, err = NewFSObjectLayer(endpointServerPools[0].Endpoints[0].Path) if err == nil { return newObject, nil } diff --git a/cmd/server-startup-msg_test.go b/cmd/server-startup-msg_test.go index b305b64ac..3024addaf 100644 --- a/cmd/server-startup-msg_test.go +++ b/cmd/server-startup-msg_test.go @@ -18,7 +18,6 @@ package cmd import ( - "context" "os" "reflect" "strings" @@ -72,10 +71,7 @@ func TestStripStandardPorts(t *testing.T) { // Test printing server common message. func TestPrintServerCommonMessage(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -90,10 +86,7 @@ func TestPrintServerCommonMessage(t *testing.T) { // Tests print cli access message. func TestPrintCLIAccessMsg(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -108,10 +101,7 @@ func TestPrintCLIAccessMsg(t *testing.T) { // Test print startup message. func TestPrintStartupMessage(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/signature-v2_test.go b/cmd/signature-v2_test.go index 5125a952c..4a00ad2c0 100644 --- a/cmd/signature-v2_test.go +++ b/cmd/signature-v2_test.go @@ -18,7 +18,6 @@ package cmd import ( - "context" "fmt" "net/http" "net/url" @@ -42,10 +41,7 @@ func TestResourceListSorting(t *testing.T) { // Tests presigned v2 signature. func TestDoesPresignedV2SignatureMatch(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -165,10 +161,7 @@ func TestDoesPresignedV2SignatureMatch(t *testing.T) { // TestValidateV2AuthHeader - Tests validate the logic of V2 Authorization header validator. func TestValidateV2AuthHeader(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -239,10 +232,7 @@ func TestValidateV2AuthHeader(t *testing.T) { } func TestDoesPolicySignatureV2Match(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/signature-v4-utils_test.go b/cmd/signature-v4-utils_test.go index fe876b91a..97a156eee 100644 --- a/cmd/signature-v4-utils_test.go +++ b/cmd/signature-v4-utils_test.go @@ -33,7 +33,7 @@ func TestCheckValid(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } @@ -42,7 +42,8 @@ func TestCheckValid(t *testing.T) { t.Fatalf("unable initialize config file, %s", err) } - initAllSubsystems(ctx) + initAllSubsystems() + initConfigSubsystem(ctx, objLayer) globalIAMSys.Init(ctx, objLayer, globalEtcdClient, 2*time.Second) diff --git a/cmd/signature-v4_test.go b/cmd/signature-v4_test.go index 3a96179a5..26e3aa67d 100644 --- a/cmd/signature-v4_test.go +++ b/cmd/signature-v4_test.go @@ -18,7 +18,6 @@ package cmd import ( - "context" "fmt" "net/http" "net/url" @@ -94,10 +93,7 @@ func TestDoesPolicySignatureMatch(t *testing.T) { } func TestDoesPresignedSignatureMatch(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - obj, fsDir, err := prepareFS(ctx) + obj, fsDir, err := prepareFS() if err != nil { t.Fatal(err) } diff --git a/cmd/test-utils_test.go b/cmd/test-utils_test.go index a5692bf84..98485e917 100644 --- a/cmd/test-utils_test.go +++ b/cmd/test-utils_test.go @@ -187,7 +187,7 @@ func calculateStreamContentLength(dataLen, chunkSize int64) int64 { return streamLen } -func prepareFS(ctx context.Context) (ObjectLayer, string, error) { +func prepareFS() (ObjectLayer, string, error) { nDisks := 1 fsDirs, err := getRandomDisks(nDisks) if err != nil { @@ -198,9 +198,9 @@ func prepareFS(ctx context.Context) (ObjectLayer, string, error) { return nil, "", err } - initAllSubsystems(ctx) + initAllSubsystems() - globalIAMSys.Init(ctx, obj, globalEtcdClient, 2*time.Second) + globalIAMSys.Init(context.Background(), obj, globalEtcdClient, 2*time.Second) return obj, fsDirs[0], nil } @@ -234,7 +234,7 @@ func initFSObjects(disk string, t *testing.T) (obj ObjectLayer) { newTestConfig(globalMinioDefaultRegion, obj) - initAllSubsystems(GlobalContext) + initAllSubsystems() return obj } @@ -366,7 +366,7 @@ func initTestServerWithBackend(ctx context.Context, t TestErrHandler, testServer globalMinioPort = port globalMinioAddr = getEndpointsLocalAddr(testServer.Disks) - initAllSubsystems(ctx) + initAllSubsystems() globalEtcdClient = nil @@ -445,7 +445,7 @@ func resetGlobalIsErasure() { func resetGlobalHealState() { // Init global heal state if globalAllHealState == nil { - globalAllHealState = newHealState(GlobalContext, false) + globalAllHealState = newHealState(false) } else { globalAllHealState.Lock() for _, v := range globalAllHealState.healSeqMap { @@ -458,7 +458,7 @@ func resetGlobalHealState() { // Init background heal state if globalBackgroundHealState == nil { - globalBackgroundHealState = newHealState(GlobalContext, false) + globalBackgroundHealState = newHealState(false) } else { globalBackgroundHealState.Lock() for _, v := range globalBackgroundHealState.healSeqMap { @@ -1474,7 +1474,7 @@ func getRandomDisks(N int) ([]string, error) { // Initialize object layer with the supplied disks, objectLayer is nil upon any error. func newTestObjectLayer(ctx context.Context, endpointServerPools EndpointServerPools) (newObject ObjectLayer, err error) { - initAllSubsystems(ctx) + initAllSubsystems() return newErasureServerPools(ctx, endpointServerPools) } @@ -1518,7 +1518,7 @@ func removeDiskN(disks []string, n int) { // initialies the root and returns its path. // return credentials. func initAPIHandlerTest(ctx context.Context, obj ObjectLayer, endpoints []string) (string, http.Handler, error) { - initAllSubsystems(ctx) + initAllSubsystems() initConfigSubsystem(ctx, obj) @@ -1556,7 +1556,7 @@ func prepareTestBackend(ctx context.Context, instanceType string) (ObjectLayer, return prepareErasure16(ctx) default: // return FS backend by default. - obj, disk, err := prepareFS(ctx) + obj, disk, err := prepareFS() if err != nil { return nil, nil, err } @@ -1725,7 +1725,7 @@ func ExecObjectLayerAPITest(t *testing.T, objAPITest objAPITestType, endpoints [ // this is to make sure that the tests are not affected by modified value. resetTestGlobals() - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatalf("Initialization of object layer failed for single node setup: %s", err) } @@ -1793,12 +1793,13 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) { localMetacacheMgr.deleteAll() } - objLayer, fsDir, err := prepareFS(ctx) + objLayer, fsDir, err := prepareFS() if err != nil { t.Fatalf("Initialization of object layer failed for single node setup: %s", err) } setObjectLayer(objLayer) - initAllSubsystems(ctx) + + initAllSubsystems() // initialize the server and obtain the credentials and root. // credentials are necessary to sign the HTTP request. @@ -1824,7 +1825,7 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) { localMetacacheMgr.deleteAll() } - initAllSubsystems(ctx) + initAllSubsystems() objLayer, fsDirs, err := prepareErasureSets32(ctx) if err != nil { t.Fatalf("Initialization of object layer failed for Erasure setup: %s", err)