Fix aggregated API server readiness race causing sporadic 503s in envtest suites - #1505
Conversation
5c84f62 to
59f9a9f
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds an aggregated API serve-readiness probe to envtest after discovery succeeds. It issues ChangesAggregated API Server Serve Readiness
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
utils/envtest/envtest.go (1)
757-767: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winStabilize list target selection.
scheme.AllKnownTypes()is map-backed, sofirstListTypeForGroupVersioncan return a differentclient.ObjectListkind on different runs. Sort the candidates (for example byKind) before choosing one.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@utils/envtest/envtest.go` around lines 757 - 767, The list selection in firstListTypeForGroupVersion is nondeterministic because it iterates scheme.AllKnownTypes() directly over a map, so the returned client.ObjectList type can vary between runs. Collect the matching candidates for the requested schema.GroupVersion, sort them deterministically (for example by GVK.Kind), and then choose the first matching reflect.Type so the selection is stable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@utils/envtest/envtest.go`:
- Around line 757-767: The list selection in firstListTypeForGroupVersion is
nondeterministic because it iterates scheme.AllKnownTypes() directly over a map,
so the returned client.ObjectList type can vary between runs. Collect the
matching candidates for the requested schema.GroupVersion, sort them
deterministically (for example by GVK.Kind), and then choose the first matching
reflect.Type so the selection is stable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 517d2afd-a6ff-4922-aad2-8bc8dbf528e6
📒 Files selected for processing (1)
utils/envtest/envtest.go
e74d1ca to
822e018
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
1d61bfd to
414fad1
Compare
524909f to
cf9fd36
Compare
…test suites Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
cf9fd36 to
e85c99c
Compare
Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
e85c99c to
79f5931
Compare
Proposed Changes
Fix aggregated API server readiness race causing sporadic 503s in envtest suites.
Summary by CodeRabbit
Listround-trip probes for each discovered group/version.