metrics: add missing calls to Ticker.Stop in tests (#20866)

pull/20875/head
ucwong 5 years ago committed by GitHub
parent 0893ee6d51
commit 53e034ce0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      metrics/meter_test.go
  2. 1
      metrics/sample_test.go

@ -26,6 +26,7 @@ func TestMeterDecay(t *testing.T) {
ticker: time.NewTicker(time.Millisecond),
meters: make(map[*StandardMeter]struct{}),
}
defer ma.ticker.Stop()
m := newStandardMeter()
ma.meters[m] = struct{}{}
go ma.tick()

@ -346,6 +346,7 @@ func TestUniformSampleConcurrentUpdateCount(t *testing.T) {
quit := make(chan struct{})
go func() {
t := time.NewTicker(10 * time.Millisecond)
defer t.Stop()
for {
select {
case <-t.C:

Loading…
Cancel
Save