mirror of
https://github.com/prometheus/prometheus
synced 2024-12-25 07:52:28 +00:00
test:Fix two potential goroutine leaks (#8964)
Signed-off-by: lzhfromustc <lzhfromustc@gmail.com>
This commit is contained in:
parent
5afa606ecb
commit
d42be7be76
@ -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()
|
||||
}
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user