]> Cypherpunks repositories - gostls13.git/commitdiff
log: fix flaky test
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 18 Jun 2015 17:46:01 +0000 (10:46 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 18 Jun 2015 18:08:17 +0000 (18:08 +0000)
Fixes #11272.

Change-Id: I78d666c20f4f7cb7116d37fd66b5f8b7d66c53c4
Reviewed-on: https://go-review.googlesource.com/11234
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/log/log_test.go

index 709de1e542ec1afdbfa5fea3bf76fdfe869166e5..dd16c9d3e18eb0b5509f07a36b9a6de29eac668a 100644 (file)
@@ -136,9 +136,9 @@ func TestUTCFlag(t *testing.T) {
        }
        // 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.
-       now.Add(time.Second)
+       now = now.Add(time.Second)
        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 {
                return
        }