Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
add time.sleep to end of TestHealthCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari committed Feb 28, 2024
1 parent fcb7b15 commit 6a53c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion global.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 6a53c43

Please sign in to comment.