From 431d7af2812a80534a5b76d10e6dee29cd33fe28 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Thu, 20 Dec 2018 01:01:53 -0500 Subject: [PATCH] fix test --- command/job_status_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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")