diff --git a/command/job_status_test.go b/command/job_status_test.go index bac0b8cf1..e0bc40b56 100644 --- a/command/job_status_test.go +++ b/command/job_status_test.go @@ -262,6 +262,24 @@ func TestJobStatusCommand_WithAccessPolicy(t *testing.T) { token := srv.RootToken assert.NotNil(token, "failed to bootstrap ACL token") + // Wait for client ready + client.SetSecretID(token.SecretID) + testutil.WaitForResult(func() (bool, error) { + nodes, _, err := client.Nodes().List(nil) + if err != nil { + return false, err + } + if len(nodes) == 0 { + return false, fmt.Errorf("missing node") + } + if _, ok := nodes[0].Drivers["mock_driver"]; !ok { + return false, fmt.Errorf("mock_driver not ready") + } + return true, nil + }, func(err error) { + t.Fatalf("err: %s", err) + }) + // Register a job j := testJob("job1_sfx")