command: wait for drivers to be ready before test

This commit is contained in:
Nick Ethier 2018-12-20 13:52:33 -05:00
parent 5b9bba08c6
commit fad553ab6a
No known key found for this signature in database
GPG key ID: 07C1A3ECED90D24A

View file

@ -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)