mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #102657 from pohly/subpath-test-flake
storage e2e: extend timeouts for subpath restart tests
This commit is contained in:
commit
33c4383985
@ -814,10 +814,12 @@ func testPodContainerRestartWithHooks(f *framework.Framework, pod *v1.Pod, hooks
|
|||||||
ginkgo.By("Failing liveness probe")
|
ginkgo.By("Failing liveness probe")
|
||||||
hooks.FailLivenessProbe(pod, probeFilePath)
|
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")
|
ginkgo.By("Waiting for container to restart")
|
||||||
restarts := int32(0)
|
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{})
|
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(context.TODO(), pod.Name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
@ -840,11 +842,15 @@ func testPodContainerRestartWithHooks(f *framework.Framework, pod *v1.Pod, hooks
|
|||||||
ginkgo.By("Fix liveness probe")
|
ginkgo.By("Fix liveness probe")
|
||||||
hooks.FixLivenessProbe(pod, probeFilePath)
|
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")
|
ginkgo.By("Waiting for container to stop restarting")
|
||||||
stableCount := int(0)
|
stableCount := int(0)
|
||||||
stableThreshold := int(time.Minute / framework.Poll)
|
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{})
|
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get(context.TODO(), pod.Name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
Loading…
Reference in New Issue
Block a user