ROSAENG-62805 | fix(test): fail-fast destroy when uninstall times out - #3433
ROSAENG-62805 | fix(test): fail-fast destroy when uninstall times out#3433amandahla wants to merge 1 commit into
Conversation
Skip OIDC provider and prepared-resource cleanup when the cluster was not fully removed, so stuck uninstalls surface one clear error instead of cascading IAM/OIDC failures. The destroy step still fails. Signed-off-by: Amanda Hager Lopes de Andrade Katz <amanda.katz@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughCluster destruction now returns both errors and whether the cluster was fully removed. The flow treats missing clusters as removed, waits for uninstall completion before deleting the OIDC provider, and skips prepared-resource cleanup when uninstall does not complete. Tests cover the cleanup-skip predicate. Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 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.
Actionable comments posted: 2
🤖 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 `@tests/utils/handler/cluster_handler_test.go`:
- Around line 48-56: Replace the direct skipPreparedResourceCleanup assertions
with a focused mocked-handler test around Destroy(). Configure destroyCluster()
to report clusterRemoved=false, invoke Destroy(), and assert the
prepared-resource cleanup method DestroyResources() is not called. Keep the test
scoped to the uninstall-failure behavior rather than restating the helper’s
boolean inversion.
In `@tests/utils/handler/cluster_handler.go`:
- Around line 1232-1248: Wrap the errors returned by the cluster cleanup flow
with operation and cluster context using fmt.Errorf and %w. Update the
errDeleteCluster return in DeleteCluster and the err return from
WaitForClusterPassUninstalled to preserve their original causes while
identifying the failed operation and clusterID.
🪄 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 YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: ab49c7b4-8360-4615-9447-c11b12646078
📒 Files selected for processing (2)
tests/utils/handler/cluster_handler.gotests/utils/handler/cluster_handler_test.go
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amandahla 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 |
|
@amandahla: The following test 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. |
PR Summary
Fail-fast cluster destroy when uninstall does not complete: skip OIDC provider and prepared-resource cleanup so stuck uninstalls surface one clear error instead of cascading IAM/OIDC noise. The destroy step (and job) still fail.
Detailed Description of the Issue
On
rosa-hcp-advanced-f3, destroy sometimes times out waiting for uninstall (~60m). The harness then still attempted OIDC provider deletion andDestroyResources(), which fail because the cluster is still present — producing secondary errors and follow-on destroy-post failures (see ROSAENG-62643 plan item 3).Related Issues and PRs
Type of Change
Previous Behavior
After uninstall wait failure, destroy still ran OIDC cleanup and always ran
DestroyResources(), cascading noisy secondary failures.Behavior After This Change
destroyCluster()returns(errors, clusterRemoved)Destroy()skips prepared resource cleanup whenclusterRemoved == falseskipPreparedResourceCleanupThis does not root-cause hung uninstall (OCM/Hive); it only improves failure signal.
How to Test (Step-by-Step)
Preconditions
N/A for unit path; e2e destroy timeout is environment-dependent.
Test Steps
tests/utils/handler/cluster_handler.gogo test ./tests/utils/handler/make pre-push-checksExpected Results
Handler tests pass; on uninstall timeout, logs show skip of prepared resource cleanup and a single destroy error path.
Proof of the Fix
make fmt/make fmt-check/make lintOK-t committed): 0 findingsmake pre-push-checksOK (standalone); push hook OK on retry after unrelatedpkg/ocmflakeBreaking Changes
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make pre-push-checks).Made with Cursor
Summary by CodeRabbit
Bug Fixes
Tests