SPLAT-2858: Fixing test issue where error result was for other resource type#1522
Conversation
|
@vr4manta: This pull request references SPLAT-2858 which is a valid jira issue. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe vSphere failure-domain tests now detect Machine, MachineSet, and ControlPlaneMachineSet references through shared helpers. Selection tracks CPMS exclusions and exclusivity, while removal scenarios account for unused, exclusive, and shared failure domains. ChangesvSphere failure-domain reference tracking
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/vsphere/failure_domain_vap.go (1)
378-399: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMake “exclusive” exclude every competing VAP resource type.
Both tests only exclude CPMS domains. A selected FD can still be referenced by the other resource type, whose VAP may produce the admission error first; the exclusive assertions then flake.
test/e2e/vsphere/failure_domain_vap.go#L378-L399: exclude MachineSet-referenced domains before asserting that only the Machine VAP can block removal, or accept the MachineSet error on fallback.test/e2e/vsphere/failure_domain_vap.go#L409-L448: exclude Machine-referenced domains before asserting that only the MachineSet VAP can block removal, or accept the Machine error on fallback.🤖 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 `@test/e2e/vsphere/failure_domain_vap.go` around lines 378 - 399, Make both VAP tests account for every competing resource type when determining exclusivity: in the Machine-focused block around findFDUsedByMachine, exclude failure domains referenced by MachineSets before asserting the error names a Machine, or allow a MachineSet error as fallback; in the MachineSet-focused block around lines 409-448, exclude Machine-referenced domains before asserting only the ControlPlaneMachineSet VAP can block removal, or allow a Machine error as fallback.
🤖 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.
Inline comments:
In `@test/e2e/vsphere/failure_domain_vap.go`:
- Around line 99-112: Update findFDUsedByMachine so the single-failure-domain
branch does not return found=true merely because one failure domain exists.
Remove or bypass that inference and determine usage only from explicit Machine
region or zone label matches, preserving the exclusion handling for confirmed
matches.
- Around line 349-353: Update the unused-domain selection loop around
isFDReferencedByMachine and isFDReferencedByMachineSet to also exclude domains
referenced by CPMS objects. Fetch the CPMS name set before iterating, then skip
any fd whose name is present in that set so unusedFDName is selected only from
domains unreferenced by Machines, MachineSets, and CPMS.
- Around line 53-57: Update getCPMSFailureDomainNames to return both the
domain-name map and an error; treat only metav1/API IsNotFound errors as an
empty result, and propagate all other ControlPlaneMachineSets(...).Get failures.
Update every caller to handle the returned error and stop or propagate it
instead of classifying domains from a failed lookup.
---
Outside diff comments:
In `@test/e2e/vsphere/failure_domain_vap.go`:
- Around line 378-399: Make both VAP tests account for every competing resource
type when determining exclusivity: in the Machine-focused block around
findFDUsedByMachine, exclude failure domains referenced by MachineSets before
asserting the error names a Machine, or allow a MachineSet error as fallback; in
the MachineSet-focused block around lines 409-448, exclude Machine-referenced
domains before asserting only the ControlPlaneMachineSet VAP can block removal,
or allow a Machine error as fallback.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 050c16c0-0e07-4318-b75f-ee3e0458c258
📒 Files selected for processing (1)
test/e2e/vsphere/failure_domain_vap.go
|
/payload-job periodic-ci-openshift-release-main-nightly-5.0-e2e-vsphere-ovn-techpreview-serial |
|
@vr4manta: 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/ac562a90-8434-11f1-9112-5cbf294325a5-0 |
|
/payload-job periodic-ci-openshift-release-main-nightly-5.0-e2e-vsphere-ovn-zones-techpreview-serial |
|
@vr4manta: 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/b95abd50-8439-11f1-845e-9e0ce034060e-0 |
|
/retest |
|
Payload jobs both passed. Flaky test seems to be stable now. |
| ContainSubstring("in use by ControlPlaneMachineSet '"), | ||
| ), "expected error to mention 'Machine' or 'ControlPlaneMachineSet' as the blocking resource") | ||
| } | ||
| }) |
There was a problem hiding this comment.
Reviewer's note: this is the bugfux.
|
|
||
| if unusedFDName == "" { | ||
| Skip("skipping — all failure domains are in use by Machines or MachineSets") | ||
| Skip("skipping — all failure domains are in use by Machines, MachineSets, or ControlPlaneMachineSet") |
There was a problem hiding this comment.
super nit: ControlPlaneMachineSets
There was a problem hiding this comment.
i'll fix that. thx!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mdbooth 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 |
|
Unit tests are failing but it doesnt seem to be related, maybe take a look. Other than that lgtm /lgtm |
|
/retest |
|
/verified by @vr4manta via /payload-jobs |
|
@vr4manta: This PR has been marked as verified by 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. |
|
/retest |
|
@vr4manta: 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. |
SPLAT-2858
Changes
Summary by CodeRabbit