Unverified Commit 53e034ce authored by ucwong's avatar ucwong Committed by GitHub

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

parent 0893ee6d
...@@ -26,6 +26,7 @@ func TestMeterDecay(t *testing.T) { ...@@ -26,6 +26,7 @@ func TestMeterDecay(t *testing.T) {
ticker: time.NewTicker(time.Millisecond), ticker: time.NewTicker(time.Millisecond),
meters: make(map[*StandardMeter]struct{}), meters: make(map[*StandardMeter]struct{}),
} }
defer ma.ticker.Stop()
m := newStandardMeter() m := newStandardMeter()
ma.meters[m] = struct{}{} ma.meters[m] = struct{}{}
go ma.tick() go ma.tick()
......
...@@ -346,6 +346,7 @@ func TestUniformSampleConcurrentUpdateCount(t *testing.T) { ...@@ -346,6 +346,7 @@ func TestUniformSampleConcurrentUpdateCount(t *testing.T) {
quit := make(chan struct{}) quit := make(chan struct{})
go func() { go func() {
t := time.NewTicker(10 * time.Millisecond) t := time.NewTicker(10 * time.Millisecond)
defer t.Stop()
for { for {
select { select {
case <-t.C: case <-t.C:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment