Defer cleanup

This commit is contained in:
Abhishek Chanda
2016-02-10 15:55:24 -08:00
parent 07d4152017
commit 877dd7de61

View File

@@ -91,6 +91,8 @@ func TestRktDriver_Start(t *testing.T) {
}
driverCtx, execCtx := testDriverContexts(task)
defer execCtx.AllocDir.Destroy()
d := NewRktDriver(driverCtx)
handle, err := d.Start(execCtx, task)
@@ -100,6 +102,7 @@ func TestRktDriver_Start(t *testing.T) {
if handle == nil {
t.Fatalf("missing handle")
}
defer handle.Kill()
// Attempt to open
handle2, err := d.Open(execCtx, handle.ID())
@@ -249,6 +252,6 @@ func TestRktDriver_Start_Wait_Logs(t *testing.T) {
}
if len(data) == 0 {
t.Fatal("Task's stdout is empty")
t.Fatal("Task's stdout is empty: %q", stdout)
}
}