diff --git a/cli/client/service_test.go b/cli/client/service_test.go index 1bec27973..209c34657 100644 --- a/cli/client/service_test.go +++ b/cli/client/service_test.go @@ -191,7 +191,7 @@ func TestWaitForDeployment(t *testing.T) { var desiredCount int64 = 2 // simulate flapping success - if count == 0 || count > 3 { + if count == 0 || count > 3 { runningCount = 2 } @@ -215,27 +215,26 @@ func TestWaitForDeployment(t *testing.T) { } testutils.AssertEqual(t, service.ServiceID, "id") - if count < REQUIRED_SUCCESS_WAIT_COUNT { + if count < REQUIRED_SUCCESS_WAIT_COUNT { t.Fatalf("Retry count was less than required (%d)", count) } } func TestWaitForDeployment_timeout(t *testing.T) { - handler := func(w http.ResponseWriter, r *http.Request) { - service := models.Service{ - Deployments: []models.Deployment{ - {DesiredCount: 1, RunningCount: 0}, - }, - } + handler := func(w http.ResponseWriter, r *http.Request) { + service := models.Service{ + Deployments: []models.Deployment{ + {DesiredCount: 1, RunningCount: 0}, + }, + } MarshalAndWrite(t, w, service, 200) - } + } - client, server := newClientAndServer(handler) - defer server.Close() + client, server := newClientAndServer(handler) + defer server.Close() - if _, err := client.WaitForDeployment("id", time.Millisecond); err == nil { - t.Fatal("Error was nil!") - } + if _, err := client.WaitForDeployment("id", time.Millisecond); err == nil { + t.Fatal("Error was nil!") + } } - diff --git a/common/testutils/stubclock.go b/common/testutils/stubclock.go index 097cea71b..84508699d 100644 --- a/common/testutils/stubclock.go +++ b/common/testutils/stubclock.go @@ -1,8 +1,8 @@ package testutils import ( - "time" "sync" + "time" ) type StubClock struct { @@ -10,8 +10,8 @@ type StubClock struct { once sync.Once } -func (s *StubClock) init(){ - if s.Time.IsZero(){ +func (s *StubClock) init() { + if s.Time.IsZero() { s.Time = time.Now() } } diff --git a/runner/main.go b/runner/main.go index a8188f7a0..bf56d32ac 100644 --- a/runner/main.go +++ b/runner/main.go @@ -2,12 +2,12 @@ package main import ( "github.com/Sirupsen/logrus" - "github.com/urfave/cli" "github.com/quintilesims/layer0/common/aws/provider" "github.com/quintilesims/layer0/common/config" "github.com/quintilesims/layer0/common/logutils" "github.com/quintilesims/layer0/common/startup" "github.com/quintilesims/layer0/runner/job" + "github.com/urfave/cli" "os" "strings" )