diff --git a/functional_test.go b/functional_test.go index 8ad15450..1cca4a71 100644 --- a/functional_test.go +++ b/functional_test.go @@ -1618,6 +1618,8 @@ func TestHealthCheck(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), clock.Second*15) defer cancel() require.NoError(t, cluster.Restart(ctx)) + // wait for instances to come online + time.Sleep(1 * time.Second) } func TestLeakyBucketDivBug(t *testing.T) { diff --git a/global.go b/global.go index 1dbd44ca..bd0c1e7c 100644 --- a/global.go +++ b/global.go @@ -32,7 +32,7 @@ type globalManager struct { wg syncutil.WaitGroup conf BehaviorConfig log FieldLogger - instance *V1Instance // todo circular import? V1Instance also holds a reference to globalManager + instance *V1Instance // TODO circular import? V1Instance also holds a reference to globalManager metricGlobalSendDuration prometheus.Summary metricBroadcastDuration prometheus.Summary metricBroadcastCounter *prometheus.CounterVec @@ -261,6 +261,7 @@ func (gm *globalManager) broadcastPeers(ctx context.Context, updates map[string] fan.Wait() } +// Close stops all goroutines and shuts down all the peers. func (gm *globalManager) Close() { gm.wg.Stop() for _, peer := range gm.instance.GetPeerList() {