Skip to content

Commit

Permalink
Merge pull request #567 from prometheus/beorn7/counter
Browse files Browse the repository at this point in the history
Make TestCounterAddLarge more robust
  • Loading branch information
beorn7 authored May 4, 2019
2 parents e11546c + bf1f4e4 commit 906d297
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prometheus/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func TestCounterAddLarge(t *testing.T) {
}).(*counter)

// large overflows the underlying type and should therefore be stored in valBits.
large := float64(math.MaxUint64 + 1)
large := math.Nextafter(float64(math.MaxUint64), 1e20)
counter.Add(large)
if expected, got := large, math.Float64frombits(counter.valBits); expected != got {
t.Errorf("valBits expected %f, got %f.", expected, got)
Expand Down

0 comments on commit 906d297

Please sign in to comment.