node: e2e: address review comments (2022/12/12)

- use `ginkgo.DeferCleanup` instead of clean up in the AfterEach block
- encourage use of ginkgo by not extending expect.go

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
Swati Sehgal 2022-12-12 16:31:40 +00:00
parent a9e3689e63
commit 62e4d39c2f

View File

@ -74,12 +74,7 @@ var _ = SIGDescribe("ContainerLogRotation [Slow] [Serial] [Disruptive]", func()
},
}
logRotationPod = e2epod.NewPodClient(f).CreateSync(pod)
})
ginkgo.AfterEach(func() {
ginkgo.By("Deleting the log-rotation pod")
framework.Logf("Deleting pod: %s", logRotationPod.Name)
e2epod.NewPodClient(f).DeleteSync(logRotationPod.Name, metav1.DeleteOptions{}, time.Minute)
ginkgo.DeferCleanup(e2epod.NewPodClient(f).DeleteSync, logRotationPod.Name, metav1.DeleteOptions{}, time.Minute)
})
ginkgo.It("should be rotated and limited to a fixed amount of files", func(ctx context.Context) {