diff --git a/discovery/manager_test.go b/discovery/manager_test.go index 2caae0080..657130e5e 100644 --- a/discovery/manager_test.go +++ b/discovery/manager_test.go @@ -1371,7 +1371,11 @@ func (tp mockdiscoveryProvider) Run(ctx context.Context, upCh chan<- []*targetgr for i := range u.targetGroups { tgs[i] = &u.targetGroups[i] } - upCh <- tgs + select { + case <-ctx.Done(): + return + case upCh <- tgs: + } } <-ctx.Done() } diff --git a/storage/remote/queue_manager_test.go b/storage/remote/queue_manager_test.go index ccca000df..f56b6d90c 100644 --- a/storage/remote/queue_manager_test.go +++ b/storage/remote/queue_manager_test.go @@ -408,6 +408,7 @@ func TestReleaseNoninternedString(t *testing.T) { c := NewTestWriteClient() m := NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, nil, nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false) m.Start() + defer m.Stop() for i := 1; i < 1000; i++ { m.StoreSeries([]record.RefSeries{