diff --git a/consul/client_test.go b/consul/client_test.go index 2dec18d4c4..1249800949 100644 --- a/consul/client_test.go +++ b/consul/client_test.go @@ -83,11 +83,10 @@ func TestClient_JoinLAN(t *testing.T) { if _, err := c1.JoinLAN([]string{addr}); err != nil { t.Fatalf("err: %v", err) } - numServers := c1.serverMgr.GetNumServers() testutil.WaitForResult(func() (bool, error) { - return numServers == 1, nil + return c1.serverMgr.GetNumServers() == 1, nil }, func(err error) { - t.Fatalf("expected consul server: %d", numServers) + t.Fatalf("expected consul server") }) // Check the members @@ -99,10 +98,9 @@ func TestClient_JoinLAN(t *testing.T) { t.Fatalf("bad len") }) - numServers = c1.serverMgr.GetNumServers() // Check we have a new consul testutil.WaitForResult(func() (bool, error) { - return numServers == 1, nil + return c1.serverMgr.GetNumServers() == 1, nil }, func(err error) { t.Fatalf("expected consul server") })