From d17ce64ac53a9c7a3d2b4009a63e0257bcec8c05 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 23 Jan 2023 09:37:36 +0100 Subject: [PATCH] e2e storage: remove WaitForPodTerminatedInNamespace Calling WaitForPodTerminatedInNamespace after testFlexVolume is useless because the client pod that it waits for always gets deleted by testVolumeClient: https://github.com/kubernetes/kubernetes/blob/0fcc3dbd55732c501d4948840f639e00a2fe33c5/test/e2e/framework/volume/fixtures.go#L541-L546 Worse, because WaitForPodTerminatedInNamespace treats "not found" as "must keep polling", these two tests always kept waiting for 5 minutes: Kubernetes e2e suite: [It] [sig-storage] Flexvolumes should be mountable when non-attachable 6m4s The only reason why these tests passed is that WaitForPodTerminatedInNamespace used to return the "not found" API error. That is not guaranteed and about to change. --- test/e2e/storage/flexvolume.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/e2e/storage/flexvolume.go b/test/e2e/storage/flexvolume.go index 0065c406eb3..ce5efba1597 100644 --- a/test/e2e/storage/flexvolume.go +++ b/test/e2e/storage/flexvolume.go @@ -26,7 +26,6 @@ import ( "github.com/onsi/ginkgo/v2" v1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" e2enode "k8s.io/kubernetes/test/e2e/framework/node" @@ -197,11 +196,6 @@ var _ = utils.SIGDescribe("Flexvolumes", func() { testFlexVolume(ctx, driverInstallAs, config, f) - ginkgo.By("waiting for flex client pod to terminate") - if err := e2epod.WaitForPodTerminatedInNamespace(ctx, f.ClientSet, config.Prefix+"-client", "", f.Namespace.Name); !apierrors.IsNotFound(err) { - framework.ExpectNoError(err, "Failed to wait client pod terminated: %v", err) - } - ginkgo.By(fmt.Sprintf("uninstalling flexvolume %s from node %s", driverInstallAs, node.Name)) uninstallFlex(ctx, cs, node, "k8s", driverInstallAs) }) @@ -217,11 +211,6 @@ var _ = utils.SIGDescribe("Flexvolumes", func() { testFlexVolume(ctx, driverInstallAs, config, f) - ginkgo.By("waiting for flex client pod to terminate") - if err := e2epod.WaitForPodTerminatedInNamespace(ctx, f.ClientSet, config.Prefix+"-client", "", f.Namespace.Name); !apierrors.IsNotFound(err) { - framework.ExpectNoError(err, "Failed to wait client pod terminated: %v", err) - } - // Detach might occur after pod deletion. Wait before deleting driver. time.Sleep(detachTimeout)