command: wait for drivers to be ready before test
This commit is contained in:
parent
5b9bba08c6
commit
fad553ab6a
|
@ -113,6 +113,9 @@ func TestNodeDrainCommand_Monitor(t *testing.T) {
|
|||
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")
|
||||
}
|
||||
nodeID = nodes[0].ID
|
||||
return true, nil
|
||||
}, func(err error) {
|
||||
|
@ -186,6 +189,8 @@ func TestNodeDrainCommand_Monitor(t *testing.T) {
|
|||
_, _, err = client.Jobs().Register(sysjob, nil)
|
||||
require.Nil(err)
|
||||
|
||||
evals, _, _ := client.Evaluations().List(nil)
|
||||
|
||||
var allocs []*api.Allocation
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
allocs, _, err = client.Nodes().Allocations(nodeID, nil)
|
||||
|
|
Loading…
Reference in a new issue