e2e storage: remove WaitForPodTerminatedInNamespace

Calling WaitForPodTerminatedInNamespace after testFlexVolume is useless because
the client pod that it waits for always gets deleted by testVolumeClient:

0fcc3dbd55/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.
This commit is contained in:
Patrick Ohly 2023-01-23 09:37:36 +01:00
parent ca70940ba8
commit d17ce64ac5

View File

@ -26,7 +26,6 @@ import (
"github.com/onsi/ginkgo/v2" "github.com/onsi/ginkgo/v2"
v1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
clientset "k8s.io/client-go/kubernetes" clientset "k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
e2enode "k8s.io/kubernetes/test/e2e/framework/node" e2enode "k8s.io/kubernetes/test/e2e/framework/node"
@ -197,11 +196,6 @@ var _ = utils.SIGDescribe("Flexvolumes", func() {
testFlexVolume(ctx, driverInstallAs, config, f) 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)) ginkgo.By(fmt.Sprintf("uninstalling flexvolume %s from node %s", driverInstallAs, node.Name))
uninstallFlex(ctx, cs, node, "k8s", driverInstallAs) uninstallFlex(ctx, cs, node, "k8s", driverInstallAs)
}) })
@ -217,11 +211,6 @@ var _ = utils.SIGDescribe("Flexvolumes", func() {
testFlexVolume(ctx, driverInstallAs, config, f) 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. // Detach might occur after pod deletion. Wait before deleting driver.
time.Sleep(detachTimeout) time.Sleep(detachTimeout)