Skip to content

Commit

Permalink
Add error logging on cleanup
Browse files Browse the repository at this point in the history
Check the errors for task and container deletion during restart test
cleanup.

Signed-off-by: Derek McGowan <derek@mcg.dev>
  • Loading branch information
dmcgowan committed Dec 2, 2021
1 parent 54c0cda commit bae0d88
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions integration/client/restart_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,21 @@ version = 2
if err != nil {
t.Fatal(err)
}
defer container.Delete(ctx, WithSnapshotCleanup)
defer func() {
if err := container.Delete(ctx, WithSnapshotCleanup); err != nil {
t.Logf("failed to delete container: %v", err)
}
}()

task, err := container.NewTask(ctx, empty())
if err != nil {
t.Fatal(err)
}
defer task.Delete(ctx, WithProcessKill)
defer func() {
if _, err := task.Delete(ctx, WithProcessKill); err != nil {
t.Logf("failed to delete task: %v", err)
}
}()

if err := task.Start(ctx); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit bae0d88

Please sign in to comment.