Fixes API server to return default columns for collections
[arvados.git] / services / crunch-run / logging_test.go
index 1c8c635e9ba80da3f190a84cde9da99849487a44..ceb8ca87b00ba25a0a9dc1ac2f2f6ca591cdd0b8 100644 (file)
@@ -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")