Skip to content

Commit

Permalink
Qemu driver: defer cleanup sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseprocedure committed Nov 2, 2017
1 parent 15d7565 commit 1856585
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/driver/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ func TestQemuDriver_GracefulShutdown(t *testing.T) {
t.Fatalf("err: %v", err)
}

// Clean up
defer func() {
if err := resp.Handle.Kill(); err != nil {
logger.Printf("Error killing Qemu test: %s", err)
}
}()

// The monitor socket will not exist immediately, so we'll wait up to
// 5 seconds for it to become available.
monitorPath := fmt.Sprintf("%s/linux/%s", ctx.AllocDir.AllocDir, qemuMonitorSocketName)
Expand Down Expand Up @@ -208,13 +215,6 @@ func TestQemuDriver_GracefulShutdown(t *testing.T) {
if err := sendQemuShutdown(ctx.DriverCtx.logger, monitorPath, 0); err != nil {
t.Fatalf("unexpected error from sendQemuShutdown: %s", err)
}

// Clean up
defer func() {
if err := resp.Handle.Kill(); err != nil {
logger.Printf("Error killing Qemu test: %s", err)
}
}()
}

func TestQemuDriverUser(t *testing.T) {
Expand Down

0 comments on commit 1856585

Please sign in to comment.