aboutsummaryrefslogtreecommitdiffstats
path: root/metrics/timer_test.go
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-03-02 01:55:31 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-03-02 01:55:31 +0800
commit3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a (patch)
tree54b0c90df29bcb1a4e864285a21415211bd4b113 /metrics/timer_test.go
parent5a150e1b7724c91009a237ab0879cd64844b390d (diff)
downloaddexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.tar
dexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.tar.gz
dexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.tar.bz2
dexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.tar.lz
dexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.tar.xz
dexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.tar.zst
dexon-3ca3fffdf01b94244ef6c2d93ed38a30da9fcb0a.zip
metrics: fix flaky Example metrics test (#16222)
* metrics: add sleep to test in order to get predictable output * metrics: relax constraints on timer test
Diffstat (limited to 'metrics/timer_test.go')
-rw-r--r--metrics/timer_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/metrics/timer_test.go b/metrics/timer_test.go
index f85c9b803..c1f0ff938 100644
--- a/metrics/timer_test.go
+++ b/metrics/timer_test.go
@@ -47,8 +47,8 @@ func TestTimerStop(t *testing.T) {
func TestTimerFunc(t *testing.T) {
tm := NewTimer()
tm.Time(func() { time.Sleep(50e6) })
- if max := tm.Max(); 45e6 > max || max > 55e6 {
- t.Errorf("tm.Max(): 45e6 > %v || %v > 55e6\n", max, max)
+ if max := tm.Max(); 35e6 > max || max > 95e6 {
+ t.Errorf("tm.Max(): 35e6 > %v || %v > 95e6\n", max, max)
}
}