mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
Merge pull request #12404 from hashicorp/tests-client-waits
tests: wait on client in a couple of tests
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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}}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user