@@ -546,6 +546,7 @@ func startAndWaitTask(ctx context.Context, t *testing.T, c containerd.Container)
546
546
547
547
err = task .Start (ctx )
548
548
require .NoError (t , err , "failed to start task for container %s" , c .ID ())
549
+ defer task .Delete (ctx )
549
550
550
551
select {
551
552
case exitStatus := <- exitCh :
@@ -613,7 +614,7 @@ func TestRemoveDir_Isolated(t *testing.T) {
613
614
)
614
615
require .NoError (t , err , "failed to create container %s" , containerName )
615
616
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 ))
617
618
618
619
c2 , err := client .NewContainer (ctx ,
619
620
containerName ,
@@ -626,5 +627,5 @@ func TestRemoveDir_Isolated(t *testing.T) {
626
627
)
627
628
require .NoError (t , err , "failed to create container %s" , containerName )
628
629
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 ))
630
631
}
0 commit comments