Skip to content

Commit

Permalink
metrics: fix flaky testTestExpDecaySampleNanosecondRegression (ethe…
Browse files Browse the repository at this point in the history
  • Loading branch information
Halimao authored and stwiname committed Sep 9, 2024
1 parent d85d778 commit e7d7059
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metrics/sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ func TestExpDecaySample(t *testing.T) {
// The priority becomes +Inf quickly after starting if this is done,
// effectively freezing the set of samples until a rescale step happens.
func TestExpDecaySampleNanosecondRegression(t *testing.T) {
sw := NewExpDecaySample(100, 0.99)
for i := 0; i < 100; i++ {
sw := NewExpDecaySample(1000, 0.99)
for i := 0; i < 1000; i++ {
sw.Update(10)
}
time.Sleep(1 * time.Millisecond)
for i := 0; i < 100; i++ {
for i := 0; i < 1000; i++ {
sw.Update(20)
}
s := sw.Snapshot()
Expand Down

0 comments on commit e7d7059

Please sign in to comment.