From 2067b69b922d17ea206fe669d952e7402406a349 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 7 Jun 2021 11:39:17 +0200 Subject: [PATCH] storage e2e: extend timeouts for subpath restart tests These tests have been flaky for a long time, with a relatively low rate of flakes. Nonetheless it seems better to extend the timeouts to reduce the flakiness. --- test/e2e/storage/testsuites/subpath.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/e2e/storage/testsuites/subpath.go b/test/e2e/storage/testsuites/subpath.go index bb853aa3383..99394d78a48 100644 --- a/test/e2e/storage/testsuites/subpath.go +++ b/test/e2e/storage/testsuites/subpath.go @@ -814,10 +814,12 @@ func testPodContainerRestartWithHooks(f *framework.Framework, pod *v1.Pod, hooks ginkgo.By("Failing liveness probe") hooks.FailLivenessProbe(pod, probeFilePath) - // Check that container has restarted + // Check that container has restarted. The time that this + // might take is estimated to be lower than for "delete pod" + // and "start pod". ginkgo.By("Waiting for container to restart") restarts := int32(0) - err = wait.PollImmediate(10*time.Second, framework.PodStartTimeout, func() (bool, error) { + err = wait.PollImmediate(10*time.Second, f.Timeouts.PodDelete+f.Timeouts.PodStart, func() (bool, error) { pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(context.TODO(), pod.Name, metav1.GetOptions{}) if err != nil { return false, err @@ -840,11 +842,15 @@ func testPodContainerRestartWithHooks(f *framework.Framework, pod *v1.Pod, hooks ginkgo.By("Fix liveness probe") hooks.FixLivenessProbe(pod, probeFilePath) - // Wait for container restarts to stabilize + // Wait for container restarts to stabilize. Estimating the + // time for this is harder. In practice, + // framework.PodStartTimeout = f.Timeouts.PodStart = 5min + // turned out to be too low, therefore + // f.Timeouts.PodStartSlow = 15min is used now. ginkgo.By("Waiting for container to stop restarting") stableCount := int(0) stableThreshold := int(time.Minute / framework.Poll) - err = wait.PollImmediate(framework.Poll, framework.PodStartTimeout, func() (bool, error) { + err = wait.PollImmediate(framework.Poll, f.Timeouts.PodStartSlow, func() (bool, error) { pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(context.TODO(), pod.Name, metav1.GetOptions{}) if err != nil { return false, err