tests: deflake client TestFS_Logs_TaskPending test

This commit is contained in:
Mahmood Ali
2019-01-18 21:26:48 -05:00
parent f2f383b075
commit 92033f1a81

View File

@@ -891,7 +891,7 @@ func TestFS_Logs_TaskPending(t *testing.T) {
job := mock.BatchJob()
job.TaskGroups[0].Count = 1
job.TaskGroups[0].Tasks[0].Config = map[string]interface{}{
"start_block_for": "4s",
"start_block_for": "10s",
}
// Register job
@@ -916,6 +916,12 @@ func TestFS_Logs_TaskPending(t *testing.T) {
}
allocID = resp.Allocations[0].ID
// wait for alloc runner to be created; otherwise, we get no alloc found error
if _, err := c.getAllocRunner(allocID); err != nil {
return false, fmt.Errorf("alloc runner was not created yet for %v", allocID)
}
return true, nil
}, func(err error) {
t.Fatalf("error getting alloc id: %v", err)