Commit d1e7980d authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

log: fix flaky test

Fixes #11272.

Change-Id: I78d666c20f4f7cb7116d37fd66b5f8b7d66c53c4
Reviewed-on: https://go-review.googlesource.com/11234Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 9490fbf7
...@@ -136,9 +136,9 @@ func TestUTCFlag(t *testing.T) { ...@@ -136,9 +136,9 @@ func TestUTCFlag(t *testing.T) {
} }
// It's possible we crossed a second boundary between getting now and logging, // It's possible we crossed a second boundary between getting now and logging,
// so add a second and try again. This should very nearly always work. // so add a second and try again. This should very nearly always work.
now.Add(time.Second) now = now.Add(time.Second)
want = fmt.Sprintf("Test:%d/%.2d/%.2d %.2d:%.2d:%.2d hello\n", want = fmt.Sprintf("Test:%d/%.2d/%.2d %.2d:%.2d:%.2d hello\n",
now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute()) now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
if got == want { if got == want {
return return
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment