diff --git a/agent/agent_test.go b/agent/agent_test.go index 1f18f9c938..ab7108b02d 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -2179,6 +2179,7 @@ func TestAgent_Service_Reap(t *testing.T) { check_deregister_interval_min = "0s" `) defer a.Shutdown() + testrpc.WaitForTestAgent(t, a.RPC, "dc1") svc := &structs.NodeService{ ID: "redis", diff --git a/command/connect/ca/set/connect_ca_set_test.go b/command/connect/ca/set/connect_ca_set_test.go index bd8abd61cd..761d38a64f 100644 --- a/command/connect/ca/set/connect_ca_set_test.go +++ b/command/connect/ca/set/connect_ca_set_test.go @@ -27,7 +27,7 @@ func TestConnectCASetConfigCommand(t *testing.T) { a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() - testrpc.WaitForLeader(t, a.RPC, "dc1") + testrpc.WaitForTestAgent(t, a.RPC, "dc1") ui := cli.NewMockUi() c := New(ui) args := []string{ diff --git a/command/operator/autopilot/get/operator_autopilot_get_test.go b/command/operator/autopilot/get/operator_autopilot_get_test.go index 9fc44ce2c1..8386eb2de8 100644 --- a/command/operator/autopilot/get/operator_autopilot_get_test.go +++ b/command/operator/autopilot/get/operator_autopilot_get_test.go @@ -4,6 +4,8 @@ import ( "strings" "testing" + "github.com/hashicorp/consul/testrpc" + "github.com/hashicorp/consul/agent" "github.com/mitchellh/cli" ) @@ -19,6 +21,7 @@ func TestOperatorAutopilotGetConfigCommand(t *testing.T) { t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() + testrpc.WaitForTestAgent(t, a.RPC, "dc1") ui := cli.NewMockUi() c := New(ui) diff --git a/command/operator/autopilot/set/operator_autopilot_set_test.go b/command/operator/autopilot/set/operator_autopilot_set_test.go index 461917165d..43f0001b2c 100644 --- a/command/operator/autopilot/set/operator_autopilot_set_test.go +++ b/command/operator/autopilot/set/operator_autopilot_set_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + "github.com/hashicorp/consul/testrpc" + "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/agent/consul/autopilot" "github.com/hashicorp/consul/agent/structs" @@ -22,6 +24,7 @@ func TestOperatorAutopilotSetConfigCommand(t *testing.T) { t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() + testrpc.WaitForTestAgent(t, a.RPC, "dc1") ui := cli.NewMockUi() c := New(ui) diff --git a/connect/proxy/proxy_test.go b/connect/proxy/proxy_test.go index bec83af4ed..f60ac65e2c 100644 --- a/connect/proxy/proxy_test.go +++ b/connect/proxy/proxy_test.go @@ -26,8 +26,8 @@ func TestProxy_public(t *testing.T) { a := agent.NewTestAgent(t.Name(), "") defer a.Shutdown() + testrpc.WaitForTestAgent(t, a.RPC, "dc1") client := a.Client() - testrpc.WaitForLeader(t, a.RPC, "dc1") // Register the service so we can get a leaf cert _, err := client.Catalog().Register(&api.CatalogRegistration{ diff --git a/connect/service_test.go b/connect/service_test.go index ce3b7c7a72..704fcb337c 100644 --- a/connect/service_test.go +++ b/connect/service_test.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/api" + "github.com/hashicorp/consul/testrpc" "github.com/hashicorp/consul/testutil/retry" "github.com/stretchr/testify/require" ) @@ -128,6 +129,7 @@ func TestService_ServerTLSConfig(t *testing.T) { a := agent.NewTestAgent("007", "") defer a.Shutdown() + testrpc.WaitForTestAgent(t, a.RPC, "dc1") client := a.Client() agent := client.Agent() diff --git a/connect/tls_test.go b/connect/tls_test.go index 5df491866f..31dc7548f9 100644 --- a/connect/tls_test.go +++ b/connect/tls_test.go @@ -6,6 +6,8 @@ import ( "encoding/pem" "testing" + "github.com/hashicorp/consul/testrpc" + "github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/api" @@ -143,6 +145,7 @@ func TestServerSideVerifier(t *testing.T) { // Setup a local test agent to query agent := agent.NewTestAgent("test-consul", "") defer agent.Shutdown() + testrpc.WaitForTestAgent(t, agent.RPC, "dc1") cfg := api.DefaultConfig() cfg.Address = agent.HTTPAddr() diff --git a/watch/funcs_test.go b/watch/funcs_test.go index 2f3ee12bf9..1836730c44 100644 --- a/watch/funcs_test.go +++ b/watch/funcs_test.go @@ -7,6 +7,8 @@ import ( "testing" "time" + "github.com/hashicorp/consul/testrpc" + "github.com/stretchr/testify/assert" "github.com/hashicorp/consul/agent" @@ -532,6 +534,7 @@ func TestConnectRootsWatch(t *testing.T) { // NewTestAgent will bootstrap a new CA a := agent.NewTestAgent(t.Name(), "") defer a.Shutdown() + testrpc.WaitForTestAgent(t, a.RPC, "dc1") var originalCAID string invoke := makeInvokeCh()