mirror of
https://github.com/golang/go
synced 2024-11-12 00:20:22 -07:00
time: during short test, do not bother tickers take longer than expected
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5752058
This commit is contained in:
parent
aabbcda816
commit
db80edde7d
@ -22,7 +22,7 @@ func TestTicker(t *testing.T) {
|
||||
dt := t1.Sub(t0)
|
||||
target := Delta * Count
|
||||
slop := target * 2 / 10
|
||||
if dt < target-slop || dt > target+slop {
|
||||
if dt < target-slop || (!testing.Short() && dt > target+slop) {
|
||||
t.Fatalf("%d %s ticks took %s, expected [%s,%s]", Count, Delta, dt, target-slop, target+slop)
|
||||
}
|
||||
// Now test that the ticker stopped
|
||||
|
Loading…
Reference in New Issue
Block a user