Merge pull request #103593 from matthyx/container_probe

Flake #99979 increase delay for ready state propagation
This commit is contained in:
Kubernetes Prow Robot
2021-08-05 14:09:19 -07:00
committed by GitHub

View File

@@ -406,17 +406,18 @@ var _ = SIGDescribe("Probing container", func() {
ginkgo.It("should be ready immediately after startupProbe succeeds", func() { ginkgo.It("should be ready immediately after startupProbe succeeds", func() {
// Probe workers sleep at Kubelet start for a random time which is at most PeriodSeconds // Probe workers sleep at Kubelet start for a random time which is at most PeriodSeconds
// this test requires both readiness and startup workers running before updating statuses // this test requires both readiness and startup workers running before updating statuses
// to avoid flakes, ensure sleep before startup (22s) > readinessProbe.PeriodSeconds // to avoid flakes, ensure sleep before startup (32s) > readinessProbe.PeriodSeconds
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 22; echo ok >/tmp/startup; sleep 600"} cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 32; echo ok >/tmp/startup; sleep 600"}
readinessProbe := &v1.Probe{ readinessProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/cat", "/tmp/health"}), Handler: execHandler([]string{"/bin/cat", "/tmp/health"}),
InitialDelaySeconds: 0, InitialDelaySeconds: 0,
PeriodSeconds: 20, PeriodSeconds: 30,
} }
startupProbe := &v1.Probe{ startupProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/cat", "/tmp/startup"}), Handler: execHandler([]string{"/bin/cat", "/tmp/startup"}),
InitialDelaySeconds: 0, InitialDelaySeconds: 0,
FailureThreshold: 60, FailureThreshold: 120,
PeriodSeconds: 5,
} }
p := podClient.Create(startupPodSpec(startupProbe, readinessProbe, nil, cmd)) p := podClient.Create(startupPodSpec(startupProbe, readinessProbe, nil, cmd))
@@ -445,8 +446,8 @@ var _ = SIGDescribe("Probing container", func() {
if readyIn < 0 { if readyIn < 0 {
framework.Failf("Pod became ready before startupProbe succeeded") framework.Failf("Pod became ready before startupProbe succeeded")
} }
if readyIn > 5*time.Second { if readyIn > 25*time.Second {
framework.Failf("Pod became ready in %v, more than 5s after startupProbe succeeded. It means that the delay readiness probes were not initiated immediately after startup finished.", readyIn) framework.Failf("Pod became ready in %v, more than 25s after startupProbe succeeded. It means that the delay readiness probes were not initiated immediately after startup finished.", readyIn)
} }
}) })