test: Do SynchronousDelete cleanup before testing ImageIsUnpacked

Simply delete the image will not clean up the snapshots.

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
This commit is contained in:
Li Yuxuan 2019-11-17 11:01:35 +08:00
parent ec661e8ceb
commit 19f7f3ccc4

View File

@ -45,7 +45,8 @@ func TestImageIsUnpacked(t *testing.T) {
defer client.Close()
// Cleanup
err = client.ImageService().Delete(ctx, imageName)
opts := []images.DeleteOpt{images.SynchronousDelete()}
err = client.ImageService().Delete(ctx, imageName, opts...)
if err != nil && !errdefs.IsNotFound(err) {
t.Fatal(err)
}