8016: Fix timestamp format (add missing nanoseconds), and use it in tests.
[arvados.git] / services / crunch-run / logging_test.go
index bb3123a1025a810f0165219967161b6977d8f889..ceb8ca87b00ba25a0a9dc1ac2f2f6ca591cdd0b8 100644 (file)
@@ -16,7 +16,11 @@ type TestTimestamper struct {
 
 func (this *TestTimestamper) Timestamp(t time.Time) string {
        this.count += 1
-       return fmt.Sprintf("2015-12-29T15:51:45.%09dZ", this.count)
+       t, err := time.ParseInLocation(time.RFC3339Nano, fmt.Sprintf("2015-12-29T15:51:45.%09dZ", this.count), t.Location())
+       if err != nil {
+               panic(err)
+       }
+       return RFC3339Timestamp(t)
 }
 
 // Gocheck boilerplate