From 62e4d39c2f3637e3b4fbc1e818ba781fd3ed0d5c Mon Sep 17 00:00:00 2001 From: Swati Sehgal Date: Mon, 12 Dec 2022 16:31:40 +0000 Subject: [PATCH] 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 --- test/e2e_node/container_log_rotation_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/e2e_node/container_log_rotation_test.go b/test/e2e_node/container_log_rotation_test.go index 6a6a2708446..f281a156405 100644 --- a/test/e2e_node/container_log_rotation_test.go +++ b/test/e2e_node/container_log_rotation_test.go @@ -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) {