ocsp: fix test flakiness

The test was assuming that the OCSP creation wouldn't cross a minute
boundary, which is flakey nonsense. Instead assert that the timestamp in
the OCSP response is within an hour of when we check it.

Change-Id: I3c822b738e9b04385319eb29a1cd275dc2ed112e
Reviewed-on: https://go-review.googlesource.com/36648
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/ocsp/ocsp_test.go b/ocsp/ocsp_test.go
index a3c8986..d325d85 100644
--- a/ocsp/ocsp_test.go
+++ b/ocsp/ocsp_test.go
@@ -225,7 +225,6 @@
 		},
 	}
 
-	producedAt := time.Now().Truncate(time.Minute)
 	thisUpdate := time.Date(2010, 7, 7, 15, 1, 5, 0, time.UTC)
 	nextUpdate := time.Date(2010, 7, 7, 18, 35, 17, 0, time.UTC)
 	template := Response{
@@ -284,8 +283,9 @@
 				t.Errorf("resp.Extensions: got %v, want %v", resp.Extensions, template.ExtraExtensions)
 			}
 
-			if !resp.ProducedAt.Equal(producedAt) {
-				t.Errorf("resp.ProducedAt: got %d, want %d", resp.ProducedAt, producedAt)
+			delay := time.Since(resp.ProducedAt)
+			if delay < -time.Hour || delay > time.Hour {
+				t.Errorf("resp.ProducedAt: got %s, want close to current time (%s)", resp.ProducedAt, time.Now())
 			}
 
 			if resp.Status != template.Status {