forked from cerc-io/plugeth
metrics: add missing calls to Ticker.Stop in tests (#20866)
This commit is contained in:
parent
0893ee6d51
commit
53e034ce0b
@ -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) {
|
|||||||
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:
|
||||||
|
Loading…
Reference in New Issue
Block a user