e2e: move AdminKubeClient() from init to BeforeEach in router config_manager test#31335
e2e: move AdminKubeClient() from init to BeforeEach in router config_manager test#31335redhat-chai-bot wants to merge 1 commit into
Conversation
…manager test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughIn ChangesRouter config manager test setup
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Good question! I investigated this and Here's what it does at construction time (Describe scope):
The heavy lifting (kubeconfig file reads, API calls, project creation) all happens inside those deferred In contrast, This is the standard pattern across hundreds of test files in openshift/origin — moving |
|
/test verify-deps |
|
/retest verify-deps |
|
|
|
/retest verify-deps |
|
/test verify-deps |
|
@stbenjam what's the plan with this? |
|
Just needs someone to review and tag, I can approve it but it needs a second person to lgtm /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damdo, redhat-chai-bot, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/pipeline auto |
|
The |
|
/pipeline required |
|
Scheduling required tests: |
|
@redhat-chai-bot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
Move
kubeClient = oc.AdminKubeClient()from Ginkgo Describe-block scope (test tree construction time) to inside theBeforeEachblock (test runtime) intest/extended/router/config_manager.go.Root Cause
The
AdminKubeClient()call at line 68 executes during Ginkgo'sBuildTree()phase — when tests are being registered, not executed. If the kubeconfig file is unavailable at registration time (e.g. credential lifecycle issue, file cleanup race),AdminKubeClient()callsFatalErr()which panics the entire Ginkgo process.This kills every test scheduled in that binary — not just the router tests — causing cascading failures across unrelated SIGs (
sig-api-machinery,sig-apps,sig-auth,sig-cli,sig-node, etc.).Impact
In the last 7 days on OCP 5.0:
ci-5.0-e2e-gcp-ovn-upgraderouter.init.func2+config_manager.go:68stacktraceFix
Move the single
kubeClient = oc.AdminKubeClient()assignment into the existingBeforeEachblock. Theoc = exutil.NewCLIWithPodSecurityLevel(...)call remains at Describe scope — it only creates the CLI struct without making API calls.This is the only
AdminKubeClient()call at Describe scope across all router test files.Failing Job
periodic-ci-openshift-release-main-ci-5.0-e2e-gcp-ovn-upgrade #2069723201876791296 — 435 test failures, 165 caused by the
router.init.func2panic.Summary by CodeRabbit