Skip to content

Commit 3d6b10a

Browse files
committed
Delete tasks and snapshots explicitly
Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent adc88dc commit 3d6b10a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runtime/service_integ_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ func startAndWaitTask(ctx context.Context, t *testing.T, c containerd.Container)
546546

547547
err = task.Start(ctx)
548548
require.NoError(t, err, "failed to start task for container %s", c.ID())
549+
defer task.Delete(ctx)
549550

550551
select {
551552
case exitStatus := <-exitCh:
@@ -613,7 +614,7 @@ func TestRemoveDir_Isolated(t *testing.T) {
613614
)
614615
require.NoError(t, err, "failed to create container %s", containerName)
615616
require.Equal(t, "hello\n", startAndWaitTask(ctx, t, c1))
616-
require.NoError(t, c1.Delete(ctx))
617+
require.NoError(t, c1.Delete(ctx, containerd.WithSnapshotCleanup))
617618

618619
c2, err := client.NewContainer(ctx,
619620
containerName,
@@ -626,5 +627,5 @@ func TestRemoveDir_Isolated(t *testing.T) {
626627
)
627628
require.NoError(t, err, "failed to create container %s", containerName)
628629
require.Equal(t, "hello\n", startAndWaitTask(ctx, t, c2))
629-
require.NoError(t, c2.Delete(ctx))
630+
require.NoError(t, c2.Delete(ctx, containerd.WithSnapshotCleanup))
630631
}

0 commit comments

Comments
 (0)