Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zpatrick committed Dec 8, 2016
1 parent eee12b2 commit 9653433
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
29 changes: 14 additions & 15 deletions cli/client/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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!")
}
}

6 changes: 3 additions & 3 deletions common/testutils/stubclock.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package testutils

import (
"time"
"sync"
"time"
)

type StubClock struct {
Time time.Time
once sync.Once
}

func (s *StubClock) init(){
if s.Time.IsZero(){
func (s *StubClock) init() {
if s.Time.IsZero() {
s.Time = time.Now()
}
}
Expand Down
2 changes: 1 addition & 1 deletion runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit 9653433

Please sign in to comment.