OCPBUGS-82010: Retry fetching load balancer information in tests#443
OCPBUGS-82010: Retry fetching load balancer information in tests#443nrb wants to merge 1 commit intoopenshift:mainfrom
Conversation
Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com> Assisted-By: Claude Sonnet 4.6
|
@nrb: This pull request references Jira Issue OCPBUGS-82010, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/jira refresh |
|
@nrb: This pull request references Jira Issue OCPBUGS-82010, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go (1)
559-573: Retry logic addresses the provisioning timing issue well.The
Eventuallyblock with 3-minute timeout is appropriate for handling slower load balancer provisioning.One minor observation: lines 566-569 appear to be unreachable. Based on
getAWSLoadBalancerFromDNSName(helper.go:56-58), when the load balancer isn't found, it returns(nil, error)— never(nil, nil). So after theif err != nilcheck passes,lbis guaranteed to be non-nil.🔧 Optional: Remove unreachable code
var foundLB *elbv2types.LoadBalancer Eventually(ctx, func(ctx context.Context) error { lb, err := getAWSLoadBalancerFromDNSName(ctx, elbc, lbDNS) if err != nil { framework.Logf("Failed to find load balancer with DNS %s: %v", lbDNS, err) return err } - if lb == nil { - framework.Logf("Load balancer %s not found yet", lbDNS) - return fmt.Errorf("load balancer not found yet") - } foundLB = lb return nil }).WithTimeout(3*time.Minute).WithPolling(10*time.Second).Should(Succeed(), "failed to find load balancer with DNS name %s", lbDNS)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go` around lines 559 - 573, The check for lb == nil inside the Eventually loop is unreachable because getAWSLoadBalancerFromDNSName returns (nil, error) when not found; remove the redundant if lb == nil block and its associated log/err return, leaving only the err check and assignment to foundLB after a successful getAWSLoadBalancerFromDNSName call in the Eventually closure (referencing foundLB and getAWSLoadBalancerFromDNSName to locate the code inside the Eventually(...) block).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go`:
- Around line 559-573: The check for lb == nil inside the Eventually loop is
unreachable because getAWSLoadBalancerFromDNSName returns (nil, error) when not
found; remove the redundant if lb == nil block and its associated log/err
return, leaving only the err check and assignment to foundLB after a successful
getAWSLoadBalancerFromDNSName call in the Eventually closure (referencing
foundLB and getAWSLoadBalancerFromDNSName to locate the code inside the
Eventually(...) block).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d2f66772-4230-4432-b350-71819eb43368
📒 Files selected for processing (1)
cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go
|
/test e2e-aws-ovn |
|
/assign |
|
@nrb: all tests passed! 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. |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn-rhcos10-techpreview |
|
@mtulio: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/7166a4a0-33b7-11f1-87aa-b966f53712a3-0 |
Provisioning a load balancer is not immediate, and the tests did not retry the lookup.
With RHCOS10, the provisioning is slower, which fails the whole test when the load balancer can't be found.