mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
metrics : Add missing ticker.Stop() calls for metrics tests
This commit is contained in:
parent
66ed58bfcc
commit
a00f1d476a
2 changed files with 2 additions and 0 deletions
|
|
@ -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 a new issue