Skip to content

OCPBUGS-83812: Fix race conditions in OLM descriptors Cypress test#16304

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-83812-fix-descriptors-test-race-conditions
Apr 23, 2026
Merged

OCPBUGS-83812: Fix race conditions in OLM descriptors Cypress test#16304
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-83812-fix-descriptors-test-race-conditions

Conversation

@rhamilto
Copy link
Copy Markdown
Member

@rhamilto rhamilto commented Apr 20, 2026

Summary

Fixes race conditions in the OLM descriptors Cypress test:

  • Adds explicit document ready check in initAdmin() to prevent early test execution
  • Improves cleanup error handling by adding --ignore-not-found=true

These changes allow real errors (auth failures, CLI issues) to surface while properly handling expected "not found" scenarios during cleanup, consistent with patterns in other OLM integration tests.

Test plan

  • Verify test cleanup handles missing resources gracefully
  • Verify real errors are not masked during cleanup
  • Verify document ready check prevents early test execution

🤖 Generated with Claude Code

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-83812, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Fixes two race conditions in the OLM descriptors Cypress test that cause intermittent failures in CI:

  • Cleanup race condition: Added failOnNonZeroExit: false to the afterEach cleanup to handle cases where the custom resource doesn't exist or was already deleted
  • Initialization race condition: Added document readyState check in cy.initAdmin() to ensure the page is fully loaded before interacting with the perspective switcher

Related Issues

Fixes: https://redhat.atlassian.net/browse/OCPBUGS-83812

Test plan

  • Verify the test passes consistently
  • Confirm cleanup handles missing resources gracefully
  • Ensure cy.initAdmin() waits for page to be fully loaded

🤖 Generated with Claude Code

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.

@openshift-ci openshift-ci Bot requested review from cajieh and sg00dwin April 20, 2026 16:45
@openshift-ci openshift-ci Bot added component/olm Related to OLM kind/cypress Related to Cypress e2e integration testing approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-83812, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Includes changes from #16303, which should merge first.

Summary

Fixes two race conditions in the OLM descriptors Cypress test that cause intermittent failures in CI:

  • Cleanup race condition: Added failOnNonZeroExit: false to the afterEach cleanup to handle cases where the custom resource doesn't exist or was already deleted
  • Initialization race condition: Added document readyState check in cy.initAdmin() to ensure the page is fully loaded before interacting with the perspective switcher

Related Issues

Fixes: https://redhat.atlassian.net/browse/OCPBUGS-83812

Test plan

  • Verify the test passes consistently
  • Confirm cleanup handles missing resources gracefully
  • Ensure cy.initAdmin() waits for page to be fully loaded

🤖 Generated with Claude Code

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

This pull request refines test infrastructure and validation logic across three integration test files. The initAdmin Cypress command now waits for the document's ready state to reach 'complete' before proceeding, ensuring the page is fully loaded. A visibility assertion for the empty-box UI element was added to the CRD instances view test. The descriptor test's cleanup routine was updated to tolerate non-zero exit codes from the oc delete command, preventing test failures when resource cleanup encounters transient errors. These changes target test reliability and robustness without modifying public APIs or control flow signatures.

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR description lacks required template sections: Analysis/Root Cause, Solution Description details, Test Setup, Browser Conformance, and proper Reviewer/Assignee tags. Complete the PR description using the repository template: add detailed Analysis/Root Cause and Solution Description sections, specify Test Setup requirements, select Browser Conformance checkboxes, and assign appropriate reviewers (@openshift/team-ux-review if needed, console/docs/PX approvers).
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing race conditions in the OLM descriptors Cypress test. It includes the Jira ticket (OCPBUGS-83812) and is specific and concise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed The custom check targets Ginkgo test names (Go testing framework), but this PR contains only Cypress integration tests (TypeScript/JavaScript) with static, descriptive test titles containing no dynamic values or generated suffixes.
Test Structure And Quality ✅ Passed PR modifies Cypress integration tests (.cy.ts files), not Ginkgo Go test code as specified in check requirements; fundamentally different testing frameworks make check inapplicable.
Microshift Test Compatibility ✅ Passed MicroShift check is for Ginkgo e2e tests; this PR contains only Cypress frontend tests which don't consume OpenShift APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Custom check for SNO test compatibility is not applicable; PR modifies Cypress/JavaScript frontend tests, not Go Ginkgo e2e infrastructure tests.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies only Cypress integration test files and test support utilities. No deployment manifests, operator code, controllers, or Kubernetes scheduling constraints are present.
Ote Binary Stdout Contract ✅ Passed PR contains only TypeScript/JavaScript Cypress test files in frontend packages with no Go binaries or code subject to OTE Binary Stdout Contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The IPv6 and Disconnected Network Test Compatibility check applies only to Ginkgo e2e tests (Go-based BDD). This PR modifies only Cypress integration tests (TypeScript), which are fundamentally different frameworks with no networking assumptions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@frontend/packages/operator-lifecycle-manager/integration-tests/tests/descriptors.cy.ts`:
- Around line 19-21: The cleanup command in the afterEach uses cy.exec(`oc
delete ...`, { failOnNonZeroExit: false }) which masks all failures; update the
oc delete invocation used in descriptors.cy.ts to append the flag
--ignore-not-found=true to the oc delete command string and remove the
failOnNonZeroExit: false option so only "not found" is ignored while real errors
(auth/cli issues) still surface; locate the cy.exec call that deletes
${testCRD.spec.names.kind} ${testCR.metadata.name} and make this replacement
consistent with other tests like operator-install-global.cy.ts.
🪄 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: 4f77bfb8-f1f8-4f36-981b-bec5317297cf

📥 Commits

Reviewing files that changed from the base of the PR and between 4cc53f8 and 6fd4a38.

📒 Files selected for processing (3)
  • frontend/packages/integration-tests/support/admin.ts
  • frontend/packages/integration-tests/tests/crud/customresourcedefinition.cy.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests/tests/descriptors.cy.ts
📜 Review details
🔇 Additional comments (2)
frontend/packages/integration-tests/tests/crud/customresourcedefinition.cy.ts (1)

103-103: Good synchronization point before Create interaction.

Line 103 adds a concrete UI-ready gate and should reduce flakiness before clicking Create.

frontend/packages/integration-tests/support/admin.ts (1)

18-18: Solid hardening of cy.initAdmin() load readiness.

Line 18 adds a reliable document-ready gate before perspective switching; this should reduce intermittent detach/interaction races.

@rhamilto rhamilto force-pushed the OCPBUGS-83812-fix-descriptors-test-race-conditions branch 2 times, most recently from 5d95cb9 to c3ba7d2 Compare April 20, 2026 17:43
- Add explicit document ready check in initAdmin() to prevent early test execution
- Replace failOnNonZeroExit: false with --ignore-not-found=true in cleanup
  to allow real errors (auth, CLI issues) to surface while properly handling
  expected "not found" scenarios

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto rhamilto force-pushed the OCPBUGS-83812-fix-descriptors-test-race-conditions branch from c3ba7d2 to 6967fc5 Compare April 20, 2026 17:46
@rhamilto
Copy link
Copy Markdown
Member Author

/retest

7 similar comments
@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

Copy link
Copy Markdown
Member

@sg00dwin sg00dwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm 👍

@sg00dwin sg00dwin added the verified Signifies that the PR passed pre-merge verification criteria label Apr 22, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, sg00dwin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhamilto rhamilto added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2026
@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 23, 2026

@rhamilto: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 412dd25 into openshift:main Apr 23, 2026
8 checks passed
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: Jira Issue Verification Checks: Jira Issue OCPBUGS-83812
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-83812 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Summary

Fixes race conditions in the OLM descriptors Cypress test:

  • Adds explicit document ready check in initAdmin() to prevent early test execution
  • Improves cleanup error handling by adding --ignore-not-found=true

These changes allow real errors (auth failures, CLI issues) to surface while properly handling expected "not found" scenarios during cleanup, consistent with patterns in other OLM integration tests.

Test plan

  • Verify test cleanup handles missing resources gracefully
  • Verify real errors are not masked during cleanup
  • Verify document ready check prevents early test execution

🤖 Generated with Claude Code

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.

@rhamilto rhamilto deleted the OCPBUGS-83812-fix-descriptors-test-race-conditions branch April 23, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/olm Related to OLM jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants