X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a5260a0bd87f83b17744445476aaf7f107ca24e4..b86543493dffefb1ec245f48550cfa9e0119f4d1:/services/crunch-run/logging_test.go diff --git a/services/crunch-run/logging_test.go b/services/crunch-run/logging_test.go index 1c8c635e9b..ceb8ca87b0 100644 --- a/services/crunch-run/logging_test.go +++ b/services/crunch-run/logging_test.go @@ -4,6 +4,7 @@ import ( "fmt" "git.curoverse.com/arvados.git/sdk/go/arvadosclient" . "gopkg.in/check.v1" + "testing" "time" ) @@ -15,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 @@ -46,13 +51,16 @@ func (s *LoggingTestSuite) TestWriteLogs(c *C) { } func (s *LoggingTestSuite) TestWriteLogsLarge(c *C) { + if testing.Short() { + return + } api := &ArvTestClient{} kc := &KeepTestClient{} cr := NewContainerRunner(api, kc, nil, "zzzzz-zzzzzzzzzzzzzzz") cr.CrunchLog.Timestamper = (&TestTimestamper{}).Timestamp cr.CrunchLog.Immediate = nil - for i := 0; i < 2000000; i += 1 { + for i := 0; i < 2000000; i++ { cr.CrunchLog.Printf("Hello %d", i) } cr.CrunchLog.Print("Goodbye")