mirror of https://github.com/status-im/consul.git
Fixed flaky tests (#4626)
This commit is contained in:
parent
80b6653a8e
commit
92acdaa94c
|
@ -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",
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue