Skip to content

Commit

Permalink
Merge pull request #1686 from hashicorp/fix-tests
Browse files Browse the repository at this point in the history
Fixing alloc runner tests
  • Loading branch information
diptanu committed Sep 5, 2016
2 parents 8b5d085 + 612a16a commit b1342d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions client/alloc_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b1342d0

Please sign in to comment.