From b1a34f899fb9d35455b5a00b834b0eb9cc3b8bde Mon Sep 17 00:00:00 2001 From: Siva Prasad Date: Tue, 28 Aug 2018 09:52:11 -0400 Subject: [PATCH] TestAgentAntiEntropy: Wait until Consul service is up on the agent. (#4591) * Anti-Entropy test wait for Consul service added * Reverted some tests back to using WaitForLeader --- agent/local/state_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/agent/local/state_test.go b/agent/local/state_test.go index 92f1761429..3e77463a05 100644 --- a/agent/local/state_test.go +++ b/agent/local/state_test.go @@ -31,7 +31,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) { a := &agent.TestAgent{Name: t.Name()} a.Start() defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") // Register info args := &structs.RegisterRequest{ @@ -240,7 +240,7 @@ func TestAgentAntiEntropy_Services_ConnectProxy(t *testing.T) { a := &agent.TestAgent{Name: t.Name()} a.Start() defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") // Register node info var out struct{} @@ -378,7 +378,7 @@ func TestAgentAntiEntropy_EnableTagOverride(t *testing.T) { a := &agent.TestAgent{Name: t.Name()} a.Start() defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") args := &structs.RegisterRequest{ Datacenter: "dc1", @@ -490,7 +490,7 @@ func TestAgentAntiEntropy_Services_WithChecks(t *testing.T) { t.Parallel() a := agent.NewTestAgent(t.Name(), "") defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") { // Single check @@ -765,7 +765,7 @@ func TestAgentAntiEntropy_Checks(t *testing.T) { a.Start() defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") // Register info args := &structs.RegisterRequest{ Datacenter: "dc1", @@ -1223,7 +1223,7 @@ func TestAgentAntiEntropy_Check_DeferSync(t *testing.T) { `} a.Start() defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") // Create a check check := &structs.HealthCheck{