Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #732 from weaveworks/wait-for-presence-in-fluxsvc-…
Browse files Browse the repository at this point in the history
…test

Wait for platform presence in fluxsvc test
  • Loading branch information
squaremo authored Sep 5, 2017
2 parents 4b5710b + c50466f commit afcea4c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/fluxsvc/fluxsvc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func setup(t *testing.T) {
},
}
done := make(chan error)
messageBus.Subscribe(id, mockPlatform, done) // For ListService
messageBus.Subscribe(id, mockPlatform, done)
if err := messageBus.AwaitPresence(id, 5*time.Second); err != nil {
t.Errorf("Timed out waiting for presence of mockPlatform")
}

// History
hDb, _ := historysql.NewSQL(dbDriver, databaseSource)
Expand Down Expand Up @@ -346,7 +349,7 @@ func TestFluxsvc_Ping(t *testing.T) {
if err != nil {
t.Fatal(err)
}
t.Fatal("Request should have been ok but got %q, body:\n%v", resp.Status, body)
t.Fatal("Request should have been ok but got %q, body:\n%q", resp.Status, string(body))
}
}

Expand All @@ -371,6 +374,6 @@ func TestFluxsvc_Register(t *testing.T) {
if err != nil {
t.Fatal(err)
}
t.Fatal("Request should have been ok but got %q, body:\n%v", resp.Status, body)
t.Fatal("Request should have been ok but got %q, body:\n%q", resp.Status, string(body))
}
}

0 comments on commit afcea4c

Please sign in to comment.