From 3f8d799c9fce47d5a325c3a6e52e785256bc0d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20K=C5=99epinsk=C3=BD?= Date: Tue, 2 Jul 2024 00:15:59 +0200 Subject: [PATCH] fix readiness flake in UnhealthyPodEvictionPolicy --- test/e2e/apps/disruption.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/apps/disruption.go b/test/e2e/apps/disruption.go index d32da5255cb..2cb944ffaad 100644 --- a/test/e2e/apps/disruption.go +++ b/test/e2e/apps/disruption.go @@ -474,7 +474,7 @@ var _ = SIGDescribe("DisruptionController", func() { rs.Labels["name"] = rsName initialDelaySeconds := framework.PodStartTimeout.Seconds() + 30 if tc.podsShouldBecomeReadyFirst { - initialDelaySeconds = 0 + initialDelaySeconds = 20 } rs.Spec.Template.Spec.Containers[0].ReadinessProbe = &v1.Probe{ ProbeHandler: v1.ProbeHandler{ @@ -511,6 +511,9 @@ var _ = SIGDescribe("DisruptionController", func() { Namespace: ns, }, } + // New pods can be created between the evictions by a replica set controller. + // This can affect the PDB, and pods could potentially be evicted that shouldn't be. + // To prevent this, there should always be a sufficient pod readiness delay (see initialDelaySeconds). err = cs.CoreV1().Pods(ns).EvictV1(ctx, e) if err == nil { evictedPods.Insert(pod.Name)