Fixing alloc runner tests

This commit is contained in:
Diptanu Choudhury 2016-09-04 19:09:08 -07:00
parent 0f77d81f7d
commit ab6a9a5120
2 changed files with 5 additions and 4 deletions

View File

@ -445,9 +445,10 @@ func TestAllocRunner_SaveRestoreState_TerminalAlloc(t *testing.T) {
ar.logger = prefixedTestLogger("ar1: ") ar.logger = prefixedTestLogger("ar1: ")
// Ensure task takes some time // Ensure task takes some time
ar.alloc.Job.TaskGroups[0].Tasks[0].Driver = "mock_driver"
task := ar.alloc.Job.TaskGroups[0].Tasks[0] task := ar.alloc.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep" task.Config["run_for"] = "10s"
task.Config["args"] = []string{"1000"}
go ar.Run() go ar.Run()
testutil.WaitForResult(func() (bool, error) { testutil.WaitForResult(func() (bool, error) {

View File

@ -510,9 +510,9 @@ func TestClient_SaveRestoreState(t *testing.T) {
alloc1.NodeID = c1.Node().ID alloc1.NodeID = c1.Node().ID
alloc1.Job = job alloc1.Job = job
alloc1.JobID = job.ID alloc1.JobID = job.ID
alloc1.Job.TaskGroups[0].Tasks[0].Driver = "mock_driver"
task := alloc1.Job.TaskGroups[0].Tasks[0] task := alloc1.Job.TaskGroups[0].Tasks[0]
task.Config["command"] = "/bin/sleep" task.Config["run_for"] = "10s"
task.Config["args"] = []string{"100"}
state := s1.State() state := s1.State()
if err := state.UpsertJob(100, job); err != nil { if err := state.UpsertJob(100, job); err != nil {