Fixing alloc runner tests
This commit is contained in:
parent
0f77d81f7d
commit
ab6a9a5120
|
@ -445,9 +445,10 @@ func TestAllocRunner_SaveRestoreState_TerminalAlloc(t *testing.T) {
|
|||
ar.logger = prefixedTestLogger("ar1: ")
|
||||
|
||||
// Ensure task takes some time
|
||||
|
||||
ar.alloc.Job.TaskGroups[0].Tasks[0].Driver = "mock_driver"
|
||||
task := ar.alloc.Job.TaskGroups[0].Tasks[0]
|
||||
task.Config["command"] = "/bin/sleep"
|
||||
task.Config["args"] = []string{"1000"}
|
||||
task.Config["run_for"] = "10s"
|
||||
go ar.Run()
|
||||
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
|
|
|
@ -510,9 +510,9 @@ func TestClient_SaveRestoreState(t *testing.T) {
|
|||
alloc1.NodeID = c1.Node().ID
|
||||
alloc1.Job = job
|
||||
alloc1.JobID = job.ID
|
||||
alloc1.Job.TaskGroups[0].Tasks[0].Driver = "mock_driver"
|
||||
task := alloc1.Job.TaskGroups[0].Tasks[0]
|
||||
task.Config["command"] = "/bin/sleep"
|
||||
task.Config["args"] = []string{"100"}
|
||||
task.Config["run_for"] = "10s"
|
||||
|
||||
state := s1.State()
|
||||
if err := state.UpsertJob(100, job); err != nil {
|
||||
|
|
Loading…
Reference in New Issue