mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Close GlobalServiceDoneCh when quitting (#7322)
This change allows indefinitely running go-routines to cleanup gracefully. This channel is now closed at the beginning of each test so that long-running go-routines quit and a new one is assigned.
This commit is contained in:
committed by
kannappanr
parent
f7611bcd48
commit
e8e9cd3e74
@@ -407,6 +407,11 @@ func resetGlobalConfigPath() {
|
||||
globalConfigDir = &ConfigDir{path: ""}
|
||||
}
|
||||
|
||||
func resetGlobalServiceDoneCh() {
|
||||
close(GlobalServiceDoneCh)
|
||||
GlobalServiceDoneCh = make(chan struct{})
|
||||
}
|
||||
|
||||
// sets globalObjectAPI to `nil`.
|
||||
func resetGlobalObjectAPI() {
|
||||
globalObjLayerMutex.Lock()
|
||||
@@ -479,6 +484,9 @@ func resetGlobalIAMSys() {
|
||||
// Resets all the globals used modified in tests.
|
||||
// Resetting ensures that the changes made to globals by one test doesn't affect others.
|
||||
func resetTestGlobals() {
|
||||
// close any indefinitely running go-routines from previous
|
||||
// tests.
|
||||
resetGlobalServiceDoneCh()
|
||||
// set globalObjectAPI to `nil`.
|
||||
resetGlobalObjectAPI()
|
||||
// Reset config path set.
|
||||
|
||||
Reference in New Issue
Block a user