Skip to content

Commit a38cde3

Browse files
authored
Merge pull request kubernetes#125832 from atiratree/fix-UnhealthyPodEvictionPolicy-e2e
fix readiness flake in UnhealthyPodEvictionPolicy
2 parents e341d5b + 3f8d799 commit a38cde3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/e2e/apps/disruption.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ var _ = SIGDescribe("DisruptionController", func() {
474474
rs.Labels["name"] = rsName
475475
initialDelaySeconds := framework.PodStartTimeout.Seconds() + 30
476476
if tc.podsShouldBecomeReadyFirst {
477-
initialDelaySeconds = 0
477+
initialDelaySeconds = 20
478478
}
479479
rs.Spec.Template.Spec.Containers[0].ReadinessProbe = &v1.Probe{
480480
ProbeHandler: v1.ProbeHandler{
@@ -511,6 +511,9 @@ var _ = SIGDescribe("DisruptionController", func() {
511511
Namespace: ns,
512512
},
513513
}
514+
// New pods can be created between the evictions by a replica set controller.
515+
// This can affect the PDB, and pods could potentially be evicted that shouldn't be.
516+
// To prevent this, there should always be a sufficient pod readiness delay (see initialDelaySeconds).
514517
err = cs.CoreV1().Pods(ns).EvictV1(ctx, e)
515518
if err == nil {
516519
evictedPods.Insert(pod.Name)

0 commit comments

Comments
 (0)