From 0dd0bf39fa6be9675eb902eaffd62531b059c2b8 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Thu, 24 Sep 2015 16:59:09 -0700 Subject: [PATCH] Destroy allocdirs in task runner tests --- client/task_runner_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/task_runner_test.go b/client/task_runner_test.go index 9e2318c58..e173b9176 100644 --- a/client/task_runner_test.go +++ b/client/task_runner_test.go @@ -61,6 +61,7 @@ func TestTaskRunner_SimpleRun(t *testing.T) { upd, tr := testTaskRunner() go tr.Run() defer tr.Destroy() + defer tr.ctx.AllocDir.Destroy() select { case <-tr.WaitCh(): @@ -95,6 +96,7 @@ func TestTaskRunner_SimpleRun(t *testing.T) { func TestTaskRunner_Destroy(t *testing.T) { ctestutil.ExecCompatible(t) upd, tr := testTaskRunner() + defer tr.ctx.AllocDir.Destroy() // Change command to ensure we run for a bit tr.task.Config["command"] = "/bin/sleep" @@ -136,6 +138,7 @@ func TestTaskRunner_Update(t *testing.T) { tr.task.Config["args"] = "10" go tr.Run() defer tr.Destroy() + defer tr.ctx.AllocDir.Destroy() // Update the task definition newTask := new(structs.Task)