diff --git a/agent/consul/operator_raft_endpoint_test.go b/agent/consul/operator_raft_endpoint_test.go index 144209889d..890b76a1c9 100644 --- a/agent/consul/operator_raft_endpoint_test.go +++ b/agent/consul/operator_raft_endpoint_test.go @@ -24,7 +24,7 @@ func TestOperator_RaftGetConfiguration(t *testing.T) { codec := rpcClient(t, s1) defer codec.Close() - testrpc.WaitForLeader(t, s1.RPC, "dc1") + testrpc.WaitForTestAgent(t, s1.RPC, "dc1") arg := structs.DCSpecificRequest{ Datacenter: "dc1", @@ -71,7 +71,7 @@ func TestOperator_RaftGetConfiguration_ACLDeny(t *testing.T) { codec := rpcClient(t, s1) defer codec.Close() - testrpc.WaitForLeader(t, s1.RPC, "dc1") + testrpc.WaitForTestAgent(t, s1.RPC, "dc1") // Make a request with no token to make sure it gets denied. arg := structs.DCSpecificRequest{ @@ -208,7 +208,7 @@ func TestOperator_RaftRemovePeerByAddress_ACLDeny(t *testing.T) { codec := rpcClient(t, s1) defer codec.Close() - testrpc.WaitForLeader(t, s1.RPC, "dc1") + testrpc.WaitForTestAgent(t, s1.RPC, "dc1") // Make a request with no token to make sure it gets denied. arg := structs.RaftRemovePeerRequest{ diff --git a/agent/consul/session_ttl_test.go b/agent/consul/session_ttl_test.go index 5ede76462e..de33ee5d02 100644 --- a/agent/consul/session_ttl_test.go +++ b/agent/consul/session_ttl_test.go @@ -295,6 +295,7 @@ func TestServer_SessionTTL_Failover(t *testing.T) { dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() + testrpc.WaitForTestAgent(t, s1.RPC, "dc1") dir2, s2 := testServerDCBootstrap(t, "dc1", false) defer os.RemoveAll(dir2) diff --git a/api/acl_test.go b/api/acl_test.go index 8b02297823..2a5146f060 100644 --- a/api/acl_test.go +++ b/api/acl_test.go @@ -20,6 +20,7 @@ func TestAPI_ACLCreateDestroy(t *testing.T) { t.Parallel() c, s := makeACLClient(t) defer s.Stop() + s.WaitForSerfCheck(t) acl := c.ACL() diff --git a/api/catalog_test.go b/api/catalog_test.go index 7eff5371ad..5c73d73b11 100644 --- a/api/catalog_test.go +++ b/api/catalog_test.go @@ -670,7 +670,7 @@ func TestAPI_CatalogRegistration(t *testing.T) { Status: HealthPassing, ServiceID: "redis1", } - + checks := HealthChecks{ &HealthCheck{ Node: "foobar", @@ -848,6 +848,7 @@ func TestAPI_CatalogEnableTagOverride(t *testing.T) { t.Parallel() c, s := makeClient(t) defer s.Stop() + s.WaitForSerfCheck(t) catalog := c.Catalog() diff --git a/api/operator_autopilot_test.go b/api/operator_autopilot_test.go index 7b4a86b0dd..ac43fdc14f 100644 --- a/api/operator_autopilot_test.go +++ b/api/operator_autopilot_test.go @@ -11,6 +11,7 @@ func TestAPI_OperatorAutopilotGetSetConfiguration(t *testing.T) { t.Parallel() c, s := makeClient(t) defer s.Stop() + s.WaitForSerfCheck(t) operator := c.Operator() config, err := operator.AutopilotGetConfiguration(nil) diff --git a/api/status_test.go b/api/status_test.go index f1ad3bf420..62c8a193f1 100644 --- a/api/status_test.go +++ b/api/status_test.go @@ -8,6 +8,7 @@ func TestAPI_StatusLeader(t *testing.T) { t.Parallel() c, s := makeClient(t) defer s.Stop() + s.WaitForSerfCheck(t) status := c.Status() @@ -24,6 +25,7 @@ func TestAPI_StatusPeers(t *testing.T) { t.Parallel() c, s := makeClient(t) defer s.Stop() + s.WaitForSerfCheck(t) status := c.Status()