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

Wait for platform presence in fluxsvc test #732

Merged
merged 1 commit into from
Sep 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
}
}