Skip to content

Commit 916f72c

Browse files
committed
Increase termination timeout for evicted pods should be terminal test
This doubles the termination timeout for the eviction test from 5min to 10min. Reason for that is that the eviction manager relies on pod stats metrics, which may not be acceessible during a period of time because of the kubelet API unreachable. This could be reasoned in hardware or network pressure when multiple tests run in parallel. Signed-off-by: Sascha Grunert <[email protected]>
1 parent 24677bb commit 916f72c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

test/e2e/framework/pod/wait.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,13 +495,23 @@ func WaitForPodsWithSchedulingGates(ctx context.Context, c clientset.Interface,
495495
return err
496496
}
497497

498-
// WaitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate,
498+
// WaitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate after podStartTimeout,
499499
// if the pod Get api returns an error (IsNotFound or other), or if the pod failed (and thus did not
500500
// terminate) with an unexpected reason. Typically called to test that the passed-in pod is fully
501501
// terminated (reason==""), but may be called to detect if a pod did *not* terminate according to
502502
// the supplied reason.
503503
func WaitForPodTerminatedInNamespace(ctx context.Context, c clientset.Interface, podName, reason, namespace string) error {
504-
return WaitForPodCondition(ctx, c, namespace, podName, fmt.Sprintf("terminated with reason %s", reason), podStartTimeout, func(pod *v1.Pod) (bool, error) {
504+
return WaitForPodTerminatedInNamespaceTimeout(ctx, c, podName, reason, namespace, podStartTimeout)
505+
}
506+
507+
// WaitForPodTerminatedInNamespaceTimeout returns an error if it takes too long
508+
// for the pod to terminate after the provided timeout, if the pod Get api
509+
// returns an error (IsNotFound or other), or if the pod failed (and thus did
510+
// not terminate) with an unexpected reason. Typically called to test that the
511+
// passed-in pod is fully terminated (reason==""), but may be called to detect
512+
// if a pod did *not* terminate according to the supplied reason.
513+
func WaitForPodTerminatedInNamespaceTimeout(ctx context.Context, c clientset.Interface, podName, reason, namespace string, timeout time.Duration) error {
514+
return WaitForPodCondition(ctx, c, namespace, podName, fmt.Sprintf("terminated with reason %s", reason), timeout, func(pod *v1.Pod) (bool, error) {
505515
// Only consider Failed pods. Successful pods will be deleted and detected in
506516
// waitForPodCondition's Get call returning `IsNotFound`
507517
if pod.Status.Phase == v1.PodFailed {

test/e2e/node/pods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ var _ = SIGDescribe("Pods Extended", func() {
338338
return podClient.Delete(ctx, pod.Name, metav1.DeleteOptions{})
339339
})
340340

341-
err := e2epod.WaitForPodTerminatedInNamespace(ctx, f.ClientSet, pod.Name, "Evicted", f.Namespace.Name)
341+
err := e2epod.WaitForPodTerminatedInNamespaceTimeout(ctx, f.ClientSet, pod.Name, "Evicted", f.Namespace.Name, 15*time.Minute)
342342
if err != nil {
343343
framework.Failf("error waiting for pod to be evicted: %v", err)
344344
}

0 commit comments

Comments
 (0)