Cleaned up ZK connection code by using the backoff function. Added a test to the end to end to test that we're getting the host correctly from ZK. Changed clusters test to be an outside package.

This commit is contained in:
Renan DelValle 2017-11-28 17:30:33 -08:00
parent f60aa3dd88
commit f6a21e0f59
3 changed files with 65 additions and 71 deletions

View file

@ -55,6 +55,14 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}
func TestLeaderFromZK(t *testing.T) {
cluster := realis.GetDefaultClusterFromZKUrl("192.168.33.7:2181")
url, err := realis.LeaderFromZK(*cluster)
assert.NoError(t, err)
assert.Equal(t, url, "http://aurora.local:8081")
}
func TestRealisClient_CreateJob_Thermos(t *testing.T) {
job := realis.NewJob().