@@ -171,3 +171,30 @@ def test_apiServer_startup_initialDelaySeconds_defaults(self, kube_version):
171171 assert len (docs ) == 1
172172 c_by_name = get_containers_by_name (docs [0 ])
173173 assert c_by_name ["api-server" ]["startupProbe" ]["initialDelaySeconds" ] == 30
174+
175+ def test_scheduler_readinessprobe_and_livenessprobe_defaults_do_not_fire_in_lockstep (self , kube_version ):
176+ """PINF-1150: readinessProbe and livenessProbe run the identical exec
177+ command (fork a process, import Airflow, round-trip the DB). If both fired
178+ on the same initialDelaySeconds/periodSeconds, kubelet would trigger them
179+ at the same instant every cycle, doubling the CPU/DB load from
180+ health-checking alone at that moment -- readiness has no more timeout
181+ headroom than liveness, so it would be the first to trip under contention.
182+ This asserts values.yaml's override keeps the two offset, so a future edit
183+ can't silently reintroduce the lockstep.
184+ """
185+ docs = render_chart (
186+ kube_version = kube_version , show_only = ["charts/airflow/templates/scheduler/scheduler-deployment.yaml" ], values = {}
187+ )
188+
189+ assert len (docs ) == 1
190+ c_by_name = get_containers_by_name (docs [0 ])
191+ liveness = c_by_name ["scheduler" ]["livenessProbe" ]
192+ readiness = c_by_name ["scheduler" ]["readinessProbe" ]
193+
194+ assert liveness ["timeoutSeconds" ] == 30
195+ assert liveness ["initialDelaySeconds" ] == 10
196+ assert readiness ["initialDelaySeconds" ] == 40
197+ assert liveness ["periodSeconds" ] == readiness ["periodSeconds" ] == 60
198+ # Never coincide: the two schedules must not land on the same instant
199+ # modulo their shared period.
200+ assert (readiness ["initialDelaySeconds" ] - liveness ["initialDelaySeconds" ]) % liveness ["periodSeconds" ] != 0
0 commit comments