mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-22 07:03:28 +00:00
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 <sgrunert@redhat.com>
This commit is contained in:
@@ -495,13 +495,23 @@ func WaitForPodsWithSchedulingGates(ctx context.Context, c clientset.Interface,
|
||||
return err
|
||||
}
|
||||
|
||||
// WaitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate,
|
||||
// WaitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate after podStartTimeout,
|
||||
// if the pod Get api returns an error (IsNotFound or other), or if the pod failed (and thus did not
|
||||
// terminate) with an unexpected reason. Typically called to test that the passed-in pod is fully
|
||||
// terminated (reason==""), but may be called to detect if a pod did *not* terminate according to
|
||||
// the supplied reason.
|
||||
func WaitForPodTerminatedInNamespace(ctx context.Context, c clientset.Interface, podName, reason, namespace string) error {
|
||||
return WaitForPodCondition(ctx, c, namespace, podName, fmt.Sprintf("terminated with reason %s", reason), podStartTimeout, func(pod *v1.Pod) (bool, error) {
|
||||
return WaitForPodTerminatedInNamespaceTimeout(ctx, c, podName, reason, namespace, podStartTimeout)
|
||||
}
|
||||
|
||||
// WaitForPodTerminatedInNamespaceTimeout returns an error if it takes too long
|
||||
// for the pod to terminate after the provided timeout, if the pod Get api
|
||||
// returns an error (IsNotFound or other), or if the pod failed (and thus did
|
||||
// not terminate) with an unexpected reason. Typically called to test that the
|
||||
// passed-in pod is fully terminated (reason==""), but may be called to detect
|
||||
// if a pod did *not* terminate according to the supplied reason.
|
||||
func WaitForPodTerminatedInNamespaceTimeout(ctx context.Context, c clientset.Interface, podName, reason, namespace string, timeout time.Duration) error {
|
||||
return WaitForPodCondition(ctx, c, namespace, podName, fmt.Sprintf("terminated with reason %s", reason), timeout, func(pod *v1.Pod) (bool, error) {
|
||||
// Only consider Failed pods. Successful pods will be deleted and detected in
|
||||
// waitForPodCondition's Get call returning `IsNotFound`
|
||||
if pod.Status.Phase == v1.PodFailed {
|
||||
|
||||
@@ -338,7 +338,8 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
return podClient.Delete(ctx, pod.Name, metav1.DeleteOptions{})
|
||||
})
|
||||
|
||||
err := e2epod.WaitForPodTerminatedInNamespace(ctx, f.ClientSet, pod.Name, "Evicted", f.Namespace.Name)
|
||||
// Intentionally increase the timeout to ensure the metrics availability required for this test.
|
||||
err := e2epod.WaitForPodTerminatedInNamespaceTimeout(ctx, f.ClientSet, pod.Name, "Evicted", f.Namespace.Name, 10*time.Minute)
|
||||
if err != nil {
|
||||
framework.Failf("error waiting for pod to be evicted: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user