Merge pull request #9324 from sharifelgamal/time-cmd

give the logs test a little wiggle room
pull/9327/head
Sharif Elgamal 2020-09-25 12:23:32 -07:00 committed by GitHub
commit fb878f6f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@ func TestTimeCommandLogs(t *testing.T) {
if !ok {
t.Fatalf("expected log %s but didn't find it", log)
}
if actualTime < time {
// Let's give a little wiggle room so we don't fail if time is 3 and actualTime is 2.999
if actualTime < time && time-actualTime > 0.001 {
t.Fatalf("expected log \"%s\" to take more time than it actually did. got %v, expected > %v", log, actualTime, time)
}
}