diff --git a/metrics/meter_test.go b/metrics/meter_test.go index 0302c947d8..28472253e8 100644 --- a/metrics/meter_test.go +++ b/metrics/meter_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() diff --git a/metrics/sample_test.go b/metrics/sample_test.go index 3250d88857..c9168d3e82 100644 --- a/metrics/sample_test.go +++ b/metrics/sample_test.go @@ -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: