diff --git a/command/operator_debug_test.go b/command/operator_debug_test.go index 943aa46ed..afd09489f 100644 --- a/command/operator_debug_test.go +++ b/command/operator_debug_test.go @@ -410,7 +410,7 @@ func buildPathSlice(path string, files []string) []string { } func TestDebug_CapturedFiles(t *testing.T) { - // ci.Parallel(t) + ci.Parallel(t) srv, _, url := testServer(t, true, nil) testutil.WaitForLeader(t, srv.Agent.RPC) @@ -418,6 +418,7 @@ func TestDebug_CapturedFiles(t *testing.T) { region := srv.Config.Region serverName := fmt.Sprintf("%s.%s", serverNodeName, region) clientID := srv.Agent.Client().NodeID() + testutil.WaitForClient(t, srv.Agent.Client().RPC, clientID, srv.Agent.Client().Region()) t.Logf("serverName: %s, clientID, %s", serverName, clientID) diff --git a/command/recommendation_list_test.go b/command/recommendation_list_test.go index aef63191b..5223e84d7 100644 --- a/command/recommendation_list_test.go +++ b/command/recommendation_list_test.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/nomad/api" "github.com/hashicorp/nomad/ci" + "github.com/hashicorp/nomad/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -17,6 +18,10 @@ func TestRecommendationListCommand_Run(t *testing.T) { srv, client, url := testServer(t, true, nil) defer srv.Shutdown() + testutil.WaitForLeader(t, srv.Agent.RPC) + clientID := srv.Agent.Client().NodeID() + testutil.WaitForClient(t, srv.Agent.Client().RPC, clientID, srv.Agent.Client().Region()) + ui := cli.NewMockUi() cmd := &RecommendationListCommand{Meta: Meta{Ui: ui}} diff --git a/command/service_delete_test.go b/command/service_delete_test.go index b1862fb6a..d406ff9ca 100644 --- a/command/service_delete_test.go +++ b/command/service_delete_test.go @@ -17,6 +17,11 @@ func TestServiceDeleteCommand_Run(t *testing.T) { srv, client, url := testServer(t, true, nil) defer srv.Shutdown() + // Wait for server and client to start + testutil.WaitForLeader(t, srv.Agent.RPC) + clientID := srv.Agent.Client().NodeID() + testutil.WaitForClient(t, srv.Agent.Client().RPC, clientID, srv.Agent.Client().Region()) + // Wait until our test node is ready. testutil.WaitForResult(func() (bool, error) { nodes, _, err := client.Nodes().List(nil)