From 273ac5a594330be8fc5ab525cf06a34eae155895 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Fri, 27 Aug 2021 10:45:27 -0700 Subject: [PATCH] storege e2etest: Delete restored PVC/Pod in snapshottable --- test/e2e/storage/testsuites/snapshottable.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e/storage/testsuites/snapshottable.go b/test/e2e/storage/testsuites/snapshottable.go index af969b2ae45..ab8ed97ea00 100644 --- a/test/e2e/storage/testsuites/snapshottable.go +++ b/test/e2e/storage/testsuites/snapshottable.go @@ -317,11 +317,15 @@ func (s *snapshottableTestSuite) DefineTests(driver storageframework.TestDriver, ginkgo.By("should delete the VolumeSnapshotContent according to its deletion policy") - // Delete both Snapshot and PVC at the same time because different storage systems - // have different ordering of deletion. Some may require delete PVC first before + // Delete both Snapshot and restored Pod/PVC at the same time because different storage systems + // have different ordering of deletion. Some may require delete the restored PVC first before // Snapshot deletion and some are opposite. err = storageutils.DeleteSnapshotWithoutWaiting(dc, vs.GetNamespace(), vs.GetName()) framework.ExpectNoError(err) + framework.Logf("deleting restored pod %q/%q", restoredPod.Namespace, restoredPod.Name) + err = cs.CoreV1().Pods(restoredPod.Namespace).Delete(context.TODO(), restoredPod.Name, metav1.DeleteOptions{}) + framework.ExpectNoError(err) + framework.Logf("deleting restored PVC %q/%q", restoredPVC.Namespace, restoredPVC.Name) err = cs.CoreV1().PersistentVolumeClaims(restoredPVC.Namespace).Delete(context.TODO(), restoredPVC.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err)