OCPBUGS-83532: Fix race condition in CRD Cypress test#16288
OCPBUGS-83532: Fix race condition in CRD Cypress test#16288openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
Conversation
The customresourcedefinition.cy.ts test was failing intermittently due to a race condition. After clicking "View instances" via the kebab menu, the test immediately attempted to click the "Create YAML" button without waiting for navigation to complete. This fix adds two synchronization points: 1. URL validation to ensure navigation completed 2. Page load check to ensure the Create button is visible This eliminates the race condition and stabilizes the test. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
@rhamilto: This pull request references Jira Issue OCPBUGS-83532, 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 APPROVED This pull-request has been approved by: logonoff, rhamilto 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 |
|
/cherry-pick release-4.22 |
|
@rhamilto: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughThis change modifies the CustomResourceDefinition CRUD test to add validation during the "View instances" navigation flow. Specifically, the test now asserts that the browser URL matches the expected pattern before proceeding, and includes a visibility check for the create button on the list page. These additions serve as intermediate validation checkpoints in the existing test flow without altering any production code or public API contracts. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/retest |
|
/jira refresh |
|
@rhamilto: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-83532, 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. |
|
/override ci/prow/e2e-gcp-console |
|
@rhamilto: 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. |
|
@rhamilto: Overrode contexts on behalf of rhamilto: ci/prow/e2e-gcp-console 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 kubernetes-sigs/prow repository. |
|
@rhamilto: Jira Issue Verification Checks: Jira Issue OCPBUGS-83532 Jira Issue OCPBUGS-83532 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 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. |
|
@rhamilto: 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. |
|
@rhamilto: new pull request created: #16290 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 kubernetes-sigs/prow repository. |
|
@rhamilto: new pull request created: #16291 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 kubernetes-sigs/prow repository. |
Summary
customresourcedefinition.cy.tsProblem
The test was failing intermittently because it attempted to click the "Create YAML" button immediately after clicking "View instances" in the kebab menu, without waiting for:
This created a race condition where the button might not exist yet when Cypress tried to interact with it.
Solution
Added two synchronization points after the
clickKebabActioncall:cy.url().should('include', ...)- Ensures navigation completed to the correct URLlistPage.isCreateButtonVisible()- Ensures the page loaded and the Create button existsTest plan
cd frontend && yarn test:cypress --spec 'packages/integration-tests/tests/crud/customresourcedefinition.cy.ts'clickKebabActionfor similar race conditions🤖 Generated with Claude Code
Summary by CodeRabbit