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:
Aditya Manthramurthy
2019-03-04 14:33:14 -08:00
committed by kannappanr
parent f7611bcd48
commit e8e9cd3e74
3 changed files with 12 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ var GlobalServiceDoneCh chan struct{}
// Initialize service mutex once.
func init() {
GlobalServiceDoneCh = make(chan struct{}, 1)
GlobalServiceDoneCh = make(chan struct{})
globalServiceSignalCh = make(chan serviceSignal)
}