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

This commit is contained in:
ucwong
2020-04-02 22:01:18 +08:00
committed by GitHub
parent 0893ee6d51
commit 53e034ce0b
2 changed files with 2 additions and 0 deletions

View File

@ -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()