Merge pull request #125832 from atiratree/fix-UnhealthyPodEvictionPolicy-e2e
fix readiness flake in UnhealthyPodEvictionPolicy
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user