mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
fix: use per test context (#9343)
Instead of GlobalContext use a local context for tests. Most notably this allows stuff created to be shut down when tests using it is done. After PR #9345 9331 CI is often running out of memory/time.
This commit is contained in:
@@ -412,7 +412,7 @@ func serverMain(ctx *cli.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
newObject, err := newObjectLayer(globalEndpoints)
|
||||
newObject, err := newObjectLayer(GlobalContext, globalEndpoints)
|
||||
logger.SetDeploymentID(globalDeploymentID)
|
||||
if err != nil {
|
||||
// Stop watching for any certificate changes.
|
||||
@@ -479,7 +479,7 @@ func serverMain(ctx *cli.Context) {
|
||||
}
|
||||
|
||||
// Initialize object layer with the supplied disks, objectLayer is nil upon any error.
|
||||
func newObjectLayer(endpointZones EndpointZones) (newObject ObjectLayer, err error) {
|
||||
func newObjectLayer(ctx context.Context, endpointZones EndpointZones) (newObject ObjectLayer, err error) {
|
||||
// For FS only, directly use the disk.
|
||||
|
||||
if endpointZones.NEndpoints() == 1 {
|
||||
@@ -487,5 +487,5 @@ func newObjectLayer(endpointZones EndpointZones) (newObject ObjectLayer, err err
|
||||
return NewFSObjectLayer(endpointZones[0].Endpoints[0].Path)
|
||||
}
|
||||
|
||||
return newXLZones(endpointZones)
|
||||
return newXLZones(ctx, endpointZones)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user