test: increase timeout in pod collection deletion

Increase the current timeout of 1 minute for waiting for all pods to be
deleted to avoid flakiness. To avoiding hardcoding a timeout, use the
built in framework's `PodDelete` timeout which defaults to 5 minutes.

While we are in here, also change `framework.PodStartTimeout` to use
`f.Timeouts.PodStart` since `framework.PodStartTimeouts` are marked as
deprecated.

Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
David Porter 2022-03-18 13:40:29 -07:00
parent cd6af9e64b
commit 7ac2896a14

View File

@ -61,7 +61,6 @@ const (
syncLoopFrequency = 10 * time.Second
maxBackOffTolerance = time.Duration(1.3 * float64(kubelet.MaxContainerBackOff))
podRetryPeriod = 1 * time.Second
podRetryTimeout = 1 * time.Minute
)
// testHostIP tests that a pod gets a host IP
@ -870,7 +869,7 @@ var _ = SIGDescribe("Pods", func() {
// wait as required for all 3 pods to be running
ginkgo.By("waiting for all 3 pods to be running")
err := e2epod.WaitForPodsRunningReady(f.ClientSet, f.Namespace.Name, 3, 0, framework.PodStartTimeout, nil)
err := e2epod.WaitForPodsRunningReady(f.ClientSet, f.Namespace.Name, 3, 0, f.Timeouts.PodStart, nil)
framework.ExpectNoError(err, "3 pods not found running.")
// delete Collection of pods with a label in the current namespace
@ -880,7 +879,7 @@ var _ = SIGDescribe("Pods", func() {
// wait for all pods to be deleted
ginkgo.By("waiting for all pods to be deleted")
err = wait.PollImmediate(podRetryPeriod, podRetryTimeout, checkPodListQuantity(f, "type=Testing", 0))
err = wait.PollImmediate(podRetryPeriod, f.Timeouts.PodDelete, checkPodListQuantity(f, "type=Testing", 0))
framework.ExpectNoError(err, "found a pod(s)")
})