Skip to content

Commit

Permalink
metrics: add missing calls to Ticker.Stop in tests (ethereum#20866)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Dec 13, 2024
1 parent 47ce406 commit 1415bb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions metrics/meter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions metrics/sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1415bb6

Please sign in to comment.