Merge pull request #102657 from pohly/subpath-test-flake

storage e2e: extend timeouts for subpath restart tests
This commit is contained in:
Kubernetes Prow Robot 2021-06-18 12:12:05 -07:00 committed by GitHub
commit 33c4383985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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