Fix flaky min-scale assertions #16745
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 193 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16745"
general
weight: 0.35
dsimansk
The min-scale tests count ready endpoints, but KPA counts ready pods. A revision can become Ready before EndpointSlices catch up, causing
TestMinScaleTransitionto fail before the transition starts.Use the deployment's ready replica count in both scale helpers instead. Endpoints originally matched KPA's implementation (#6783), but KPA switched to counting pods in #8616.
Reproduce
On a kind cluster with Serving, ingress and the test images installed:
1. Add
--endpointslice-updates-batch-period=5sto kube-controller-manager's arguments in/etc/kubernetes/manifests/kube-controller-manager.yamlinside the control-plane node. Kubelet will restart it.This batches pod-triggered EndpointSlice updates for up to 5 seconds. Pods can become ready and KPA can mark the revision Ready while the service's endpoints are still catching up. The delay widens this existing race so it reproduces reliably on kind; it doesn't change pod readiness or autoscaler logic.
2. Run:
Use the cluster's usual kubeconfig, ingress and test image tag flags.
This widens the gap between pod readiness and endpoint publication. Before this change, all three runs failed with endpoint counts of 0, 0 and 3 instead of 4.
With the same delay,
TestMinScaleTransition,TestMinScaleandTestMinScaleAnnotationChangeall passed with this change. Validated on kind/Kubernetes 1.34 with the minimum-version guard overridden.``
release-note
``NONE