Skip to content

OCPBUGS-83813: Fix race conditions in debug pod Cypress tests#16305

Merged
rhamilto merged 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-83813-fix-debug-pod-test-flake
Apr 22, 2026
Merged

OCPBUGS-83813: Fix race conditions in debug pod Cypress tests#16305
rhamilto merged 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-83813-fix-debug-pod-test-flake

Conversation

@rhamilto
Copy link
Copy Markdown
Member

@rhamilto rhamilto commented Apr 20, 2026

Summary

Fixes intermittent test failures in the debug pod Cypress tests caused by race conditions when clicking links inside PatternFly Popovers that re-render asynchronously.

Changes

  • Added proper wait conditions (.should('be.visible')) before clicking debug container links in popover content
  • Applied fix to both test cases: Pod Details page and Pods Page
  • Added regression test comments linking to OCPBUGS-83813

Test plan

  • Run the affected Cypress tests to verify they no longer fail intermittently
  • Verify the tests properly wait for popover content to be stable before interaction
  • Confirm ESLint passes (no arbitrary cy.wait() calls)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Tests
    • Enhanced test reliability with improved readiness verification during initialization.
    • Added visibility checks before user interactions in Cypress tests.
    • Strengthened error handling in test cleanup processes to improve stability.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid 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-83813, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

Summary

Fixes intermittent test failures in the debug pod Cypress tests caused by race conditions when clicking links inside PatternFly Popovers that re-render asynchronously.

Changes

  • Added proper wait conditions (.should('be.visible')) before clicking debug container links in popover content
  • Applied fix to both test cases: Pod Details page and Pods Page
  • Added regression test comments linking to OCPBUGS-83813

Test plan

  • Run the affected Cypress tests to verify they no longer fail intermittently
  • Verify the tests properly wait for popover content to be stable before interaction
  • Confirm ESLint passes (no arbitrary cy.wait() calls)

🤖 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 Leo6Leo and cajieh April 20, 2026 17:30
@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
@rhamilto
Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid 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-83813, 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)
Details

In response to this:

/jira refresh

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-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-83813, 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:

Summary

Fixes intermittent test failures in the debug pod Cypress tests caused by race conditions when clicking links inside PatternFly Popovers that re-render asynchronously.

Changes

  • Added proper wait conditions (.should('be.visible')) before clicking debug container links in popover content
  • Applied fix to both test cases: Pod Details page and Pods Page
  • Added regression test comments linking to OCPBUGS-83813

Test plan

  • Run the affected Cypress tests to verify they no longer fail intermittently
  • Verify the tests properly wait for popover content to be stable before interaction
  • Confirm ESLint passes (no arbitrary cy.wait() calls)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Tests
  • Enhanced test reliability with improved readiness verification during initialization.
  • Added visibility checks before user interactions in Cypress tests.
  • Strengthened error handling in test cleanup processes to improve stability.

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 updates integration tests across multiple packages to improve test stability and readiness checks. Changes include adding document readiness verification in the admin Cypress command setup, inserting visibility assertions before clicking debug terminal links in test flows, verifying empty state UI elements are displayed, and modifying cleanup error handling to prevent test failures when resource deletion commands exit with non-zero status.

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks critical sections from the required template: Analysis/Root Cause, Solution Description, Browser Conformance, and Reviewers/Assignees are missing or incomplete. Add Analysis/Root Cause explaining the race condition mechanism, expand Solution Description with technical details, complete Browser Conformance checklist, and assign appropriate reviewers from the OpenShift Console team.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for race conditions in debug pod Cypress tests and includes the required OCPBUGS Jira reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed Custom check for Ginkgo test names is not applicable to this PR, which modifies only Cypress integration tests (TypeScript/JavaScript), not Go-based Ginkgo tests.
Test Structure And Quality ✅ Passed PR modifies only Cypress integration tests (.cy.ts files), not Ginkgo test code; check is not applicable.
Microshift Test Compatibility ✅ Passed All modified files are Cypress/TypeScript frontend UI tests using Mocha syntax, which fall outside the scope of the MicroShift Test Compatibility check designed for Go-based Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed SNO compatibility check is for Ginkgo e2e tests in Go; this PR only modifies Cypress integration tests in TypeScript/JavaScript.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only Cypress test files with readiness assertions and visibility checks; no deployment manifests, operator code, or controllers changed, making topology-aware scheduling check not applicable.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is inapplicable; changes are exclusively to Cypress test files in TypeScript/JavaScript with no Go binaries or OTE-related code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Custom check for IPv6 and Disconnected Network Test Compatibility targets Ginkgo e2e tests with Go-specific patterns; PR changes only Cypress integration tests (TypeScript/JavaScript frontend tests), making this check inapplicable to the pull request scope.

✏️ 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

🧹 Nitpick comments (1)
frontend/packages/integration-tests/tests/app/debug-pod.cy.ts (1)

73-74: Keep visibility check and click in one Cypress chain to avoid residual flake

Line 73 and Line 74 re-query the selector between assertion and click. For this specific popover re-render bug class, chaining the commands is safer and consistent with the fix used later in the file.

Proposed change
-    cy.byTestID(`popup-debug-container-link-${CONTAINER_NAME}`).should('be.visible');
-    cy.byTestID(`popup-debug-container-link-${CONTAINER_NAME}`).click();
+    cy.byTestID(`popup-debug-container-link-${CONTAINER_NAME}`).should('be.visible').click();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/packages/integration-tests/tests/app/debug-pod.cy.ts` around lines
73 - 74, The test re-queries the same selector between assertion and click which
can cause flakiness; replace the two separate statements that reference
cy.byTestID(`popup-debug-container-link-${CONTAINER_NAME}`) with a single
chained command that asserts visibility and then clicks (i.e., use
.should('be.visible').click() on the same cy.byTestID(...) chain) to avoid the
re-query and match the pattern used elsewhere in this spec.
🤖 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-22: The oc delete invocation called via cy.exec should tolerate
missing resources with the native flag instead of suppressing all errors; update
the command inside the cy.exec call that uses testCRD.spec.names.kind,
testCR.metadata.name and testName to append --ignore-not-found while keeping
failOnNonZeroExit: false so NotFound is ignored but real deletion failures
(RBAC/API/server errors) still surface before checkErrors() runs.

---

Nitpick comments:
In `@frontend/packages/integration-tests/tests/app/debug-pod.cy.ts`:
- Around line 73-74: The test re-queries the same selector between assertion and
click which can cause flakiness; replace the two separate statements that
reference cy.byTestID(`popup-debug-container-link-${CONTAINER_NAME}`) with a
single chained command that asserts visibility and then clicks (i.e., use
.should('be.visible').click() on the same cy.byTestID(...) chain) to avoid the
re-query and match the pattern used elsewhere in this spec.
🪄 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: e8ffcf00-b088-4130-842d-5484cb22db02

📥 Commits

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

📒 Files selected for processing (4)
  • frontend/packages/integration-tests/support/admin.ts
  • frontend/packages/integration-tests/tests/app/debug-pod.cy.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 (3)
frontend/packages/integration-tests/support/admin.ts (1)

18-18: Good stabilization gate before perspective switch.

This readiness assertion is a solid flake fix and keeps initAdmin() behavior consistent with initDeveloper(), improving reliability for tests that chain actions right after cy.initAdmin().

frontend/packages/integration-tests/tests/crud/customresourcedefinition.cy.ts (1)

103-103: Good readiness gate for empty-state flow.

Line 103 adds a deterministic visibility check before continuing, which is a solid flake-prevention improvement for this path.

frontend/packages/integration-tests/tests/app/debug-pod.cy.ts (1)

85-87: Nice fix pattern for popover race condition

The chained should('be.visible').click() at Line 87 is the right stabilization pattern for async popover content.

The test "Opens debug terminal page from Pods Page - Status tool tip"
fails intermittently because the PatternFly Popover re-renders
asynchronously after opening, causing the debug link element to
detach from the DOM before Cypress can click it.

This fix adds proper wait conditions to ensure the popover content
is stable and visible before attempting to click the debug link.
The same fix is applied to the similar test on the Pod Details page.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto rhamilto force-pushed the OCPBUGS-83813-fix-debug-pod-test-flake branch from d1a6fe6 to 7be2940 Compare April 20, 2026 17:47
@rhamilto
Copy link
Copy Markdown
Member Author

/retest

4 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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 21, 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.

@stefanonardo
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. 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, stefanonardo

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
Copy link
Copy Markdown
Member Author

/verified by @rhamilto

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

@rhamilto: This PR has been marked as verified by @rhamilto.

Details

In response to this:

/verified by @rhamilto

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 merged commit 233c92c into openshift:main Apr 22, 2026
8 checks passed
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: Jira Issue Verification Checks: Jira Issue OCPBUGS-83813
✔️ 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-83813 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 intermittent test failures in the debug pod Cypress tests caused by race conditions when clicking links inside PatternFly Popovers that re-render asynchronously.

Changes

  • Added proper wait conditions (.should('be.visible')) before clicking debug container links in popover content
  • Applied fix to both test cases: Pod Details page and Pods Page
  • Added regression test comments linking to OCPBUGS-83813

Test plan

  • Run the affected Cypress tests to verify they no longer fail intermittently
  • Verify the tests properly wait for popover content to be stable before interaction
  • Confirm ESLint passes (no arbitrary cy.wait() calls)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Tests
  • Enhanced test reliability with improved readiness verification during initialization.
  • Added visibility checks before user interactions in Cypress tests.
  • Strengthened error handling in test cleanup processes to improve stability.

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-83813-fix-debug-pod-test-flake branch April 22, 2026 12:22
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