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: ")
|
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) {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue