Skip to content

OCPBUGS-82512: Fix knative e2e test failures caused by createRoot timing#16289

Open
sg00dwin wants to merge 1 commit intoopenshift:mainfrom
sg00dwin:OCPBUGS-82512-knative-e2e-createroot
Open

OCPBUGS-82512: Fix knative e2e test failures caused by createRoot timing#16289
sg00dwin wants to merge 1 commit intoopenshift:mainfrom
sg00dwin:OCPBUGS-82512-knative-e2e-createroot

Conversation

@sg00dwin
Copy link
Copy Markdown
Member

@sg00dwin sg00dwin commented Apr 15, 2026

The createRoot migration defers React state batching, causing the
namespace bar dropdown and topology node labels to take longer to
appear in the DOM. Add explicit timeouts to clickProjectDropdown()
and getNode() so Cypress retries until the elements are present,
and re-enable the knative-ci.feature test suite.

Summary

  • Add 30s timeout + .should('exist') to clickProjectDropdown() in
    app.ts — fixes 7 of 8 failing knative tests where the namespace bar
    dropdown wasn't found in time under concurrent rendering
  • Add 30s timeout to getNode() in topology-page.ts — fixes 1 of 8
    failing knative tests where the topology SVG node label wasn't found in
    time
  • Re-enable knative-ci.feature test suite by removing @to-do tag
    added in c18637a

Details

The createRoot migration (CONSOLE-4512, #16202) switched React into
concurrent rendering mode, which defers state update batching. The
NamespaceBarDropdowns component returns null until the CAN_LIST_NS
feature flag resolves — under ReactDOM.render() this was synchronous,
but under createRoot the resolution is deferred past Cypress's default
4s timeout. The topology node label has the same timing issue with async
SVG rendering.

No production code is changed. The timeouts are ceilings, not delays —
Cypress resolves immediately when the element is present.

Follows the same pattern established in 60ac10e and 8f85029.

Test plan

  • ESLint passes on both modified TypeScript files
  • Ran add-page.feature locally via yarn test-cypress-dev-console
    — all tests that exercise clickProjectDropdown() pass under concurrent
    rendering
  • CI: pull-ci-openshift-console-main-e2e-gcp-console validates
    knative-ci.feature end-to-end

Assisted by Claude

Summary by CodeRabbit

  • Tests
    • Enhanced test reliability with explicit timeout configurations for element interactions
    • Re-enabled a previously disabled integration test for the Knative plugin

  The createRoot migration defers React state batching, causing the
  namespace bar dropdown and topology node labels to take longer to
  appear in the DOM. Add explicit timeouts to clickProjectDropdown()
  and getNode() so Cypress retries until the elements are present,
  and re-enable the knative-ci.feature test suite.

Assisted by Claude
@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 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

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

The createRoot migration defers React state batching, causing the
namespace bar dropdown and topology node labels to take longer to
appear in the DOM. Add explicit timeouts to clickProjectDropdown()
and getNode() so Cypress retries until the elements are present,
and re-enable the knative-ci.feature test suite.

Summary

  • Add 30s timeout + .should('exist') to clickProjectDropdown() in
    app.ts — fixes 7 of 8 failing knative tests where the namespace bar
    dropdown wasn't found in time under concurrent rendering
  • Add 30s timeout to getNode() in topology-page.ts — fixes 1 of 8
    failing knative tests where the topology SVG node label wasn't found in
    time
  • Re-enable knative-ci.feature test suite by removing @to-do tag
    added in c18637a

Details

The createRoot migration (CONSOLE-4512, #16202) switched React into
concurrent rendering mode, which defers state update batching. The
NamespaceBarDropdowns component returns null until the CAN_LIST_NS
feature flag resolves — under ReactDOM.render() this was synchronous,
but under createRoot the resolution is deferred past Cypress's default
4s timeout. The topology node label has the same timing issue with async
SVG rendering.

No production code is changed. The timeouts are ceilings, not delays —
Cypress resolves immediately when the element is present.

Follows the same pattern established in 60ac10e and 8f85029.

Test plan

  • ESLint passes on both modified TypeScript files
  • Ran add-page.feature locally via yarn test-cypress-dev-console
    — all tests that exercise clickProjectDropdown() pass under concurrent
    rendering
  • CI: pull-ci-openshift-console-main-e2e-gcp-console validates
    knative-ci.feature end-to-end

Assisted by Claude

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 rhamilto and sanketpathak April 15, 2026 16:47
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sg00dwin
Once this PR has been reviewed and has the lgtm label, please assign jrichter1 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-ci openshift-ci bot added component/dev-console Related to dev-console component/knative Related to knative-plugin component/topology Related to topology labels Apr 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

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

The createRoot migration defers React state batching, causing the
namespace bar dropdown and topology node labels to take longer to
appear in the DOM. Add explicit timeouts to clickProjectDropdown()
and getNode() so Cypress retries until the elements are present,
and re-enable the knative-ci.feature test suite.

Summary

  • Add 30s timeout + .should('exist') to clickProjectDropdown() in
    app.ts — fixes 7 of 8 failing knative tests where the namespace bar
    dropdown wasn't found in time under concurrent rendering
  • Add 30s timeout to getNode() in topology-page.ts — fixes 1 of 8
    failing knative tests where the topology SVG node label wasn't found in
    time
  • Re-enable knative-ci.feature test suite by removing @to-do tag
    added in c18637a

Details

The createRoot migration (CONSOLE-4512, #16202) switched React into
concurrent rendering mode, which defers state update batching. The
NamespaceBarDropdowns component returns null until the CAN_LIST_NS
feature flag resolves — under ReactDOM.render() this was synchronous,
but under createRoot the resolution is deferred past Cypress's default
4s timeout. The topology node label has the same timing issue with async
SVG rendering.

No production code is changed. The timeouts are ceilings, not delays —
Cypress resolves immediately when the element is present.

Follows the same pattern established in 60ac10e and 8f85029.

Test plan

  • ESLint passes on both modified TypeScript files
  • Ran add-page.feature locally via yarn test-cypress-dev-console
    — all tests that exercise clickProjectDropdown() pass under concurrent
    rendering
  • CI: pull-ci-openshift-console-main-e2e-gcp-console validates
    knative-ci.feature end-to-end

Assisted by Claude

Summary by CodeRabbit

  • Tests
  • Enhanced test reliability with explicit timeout configurations for element interactions
  • Re-enabled a previously disabled integration test for the Knative plugin

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 15, 2026

📝 Walkthrough

Walkthrough

This pull request strengthens integration test reliability across three frontend modules by introducing explicit timeout configurations. The dev-console test page now includes a 30-second wait assertion before clicking the namespace dropdown, ensuring element existence before interaction. The topology page retrieves nodes with an explicit 30-second Cypress timeout parameter. Additionally, the knative-plugin test feature removes a prior disabled status annotation, enabling the previously flagged test scenario. These changes collectively address timing issues in the test harness without altering feature logic or exposed APIs.

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the bug ID (OCPBUGS-82512) and accurately describes the core change: fixing knative e2e test failures caused by createRoot timing issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed PR modifies Cypress TypeScript page objects and Gherkin/Cucumber feature files, not Ginkgo Go tests. Check is not applicable.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test structure is not applicable; PR modifies TypeScript Cypress integration tests and Gherkin feature files, not Go-based Ginkgo tests.
Microshift Test Compatibility ✅ Passed PR modifies only Cypress TypeScript helpers and Gherkin feature files for frontend UI testing, not Ginkgo e2e tests, so MicroShift compatibility validation is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only frontend integration tests (TypeScript Cypress and Gherkin), not Go Ginkgo e2e tests, so SNO compatibility assessment is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Test infrastructure files modified contain no deployment manifests, operator code, or scheduling constraints—purely Cypress timeout adjustments and test re-enablement.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check does not apply to frontend test code. This PR modifies only Cypress page objects and Gherkin feature files, with no impact on Go binaries or their stdout contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Custom check not applicable; PR modifies only frontend Cypress/TypeScript tests and Gherkin features, not Go Ginkgo e2e tests targeting IPv6/disconnected network compatibility.

✏️ 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/topology/integration-tests/support/pages/topology/topology-page.ts`:
- Around line 292-295: The current chain uses a 30s timeout on
cy.get(topologyPO.graph.nodeLabel) but not on the subsequent text match, so
change the text match to use the explicit timeout; update the call that
currently does .contains(nodeName) to .contains(nodeName, { timeout: 30000 })
(or alternatively use cy.contains(topologyPO.graph.nodeLabel, nodeName, {
timeout: 30000 })) so the node label text matching shares the same 30s window.
🪄 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: 94d13d23-3aaf-40fa-91a0-8a9cd81c459e

📥 Commits

Reviewing files that changed from the base of the PR and between 6a8db8b and 9dd90e6.

📒 Files selected for processing (3)
  • frontend/packages/dev-console/integration-tests/support/pages/app.ts
  • frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature
  • frontend/packages/topology/integration-tests/support/pages/topology/topology-page.ts
📜 Review details
🔇 Additional comments (2)
frontend/packages/knative-plugin/integration-tests/features/e2e/knative-ci.feature (1)

1-1: Tag update correctly re-enables this feature in CI.

Removing @to-do here is consistent with the configured Cypress tag filter that excludes @to-do, so this suite will be picked up again under @knative + @smoke.

frontend/packages/dev-console/integration-tests/support/pages/app.ts (1)

253-257: Good stabilization of dropdown readiness before interaction.

The explicit 30s wait and existence check on Line 253-Line 254 are a solid fix for delayed namespace-bar rendering under concurrent React timing.

Comment on lines +292 to +295
return cy
.get(topologyPO.graph.nodeLabel, { timeout: 30000 })
.should('be.visible')
.contains(nodeName);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In Cypress, for cy.get(selector, { timeout: 30000 }).contains(text), does .contains(text)inherit the 30s timeout fromget, or does it use defaultCommandTimeout unless timeout is explicitly passed?

💡 Result:

No, .contains(text) does not inherit the 30s timeout from cy.get(selector, { timeout: 30000 }). It uses defaultCommandTimeout unless a timeout is explicitly passed to .contains. Both cy.get and .contains are queries that retry until they resolve or timeout. The timeout option set on cy.get applies specifically to waiting for the selector elements to appear in the DOM (up to 30s). Once cy.get resolves (yields elements), .contains then searches within those yielded elements for the text. Since .contains has no explicit timeout, it uses the default defaultCommandTimeout (typically 4s) for its own retry logic—retrying the text search within the subject until found or that default timeout expires. This is evidenced by official Cypress documentation: .contains explicitly states its timeout defaults to defaultCommandTimeout [6,7,10]. Query chains retry from the top using the initiating command's timeout for the entire chain's assertions, but each query command (like .contains) has its own timeout for its resolution [11,12,24]. Examples consistently show setting timeout on the first query affects chained assertions, but child queries like .contains require their own timeout option for extended waiting [16].

Citations:


🏁 Script executed:

#!/bin/bash
# Verify the file exists and check the actual code at the specified lines
if [ -f "frontend/packages/topology/integration-tests/support/pages/topology/topology-page.ts" ]; then
  echo "=== File exists, showing context around lines 292-295 ==="
  sed -n '288,300p' "frontend/packages/topology/integration-tests/support/pages/topology/topology-page.ts" | cat -n
else
  echo "File not found. Searching for topology-page.ts..."
  find . -name "topology-page.ts" -type f
fi

Repository: openshift/console

Length of output: 675


🌐 Web query:

Cypress cy.contains(selector, text, options) - Does this syntax exist and does the timeout option work on it?

💡 Result:

Yes, the syntax Cypress cy.contains(selector, text, options) exists, and the timeout option works on it. The official Cypress documentation explicitly lists this syntax and confirms that the options object includes a 'timeout' property, which overrides the defaultCommandTimeout to specify how long to wait for cy.contains to resolve before timing out.

Citations:


Timeout on text match must be explicit to prevent flakiness.

The 30-second timeout on cy.get() applies only to finding label elements; once any label appears, contains(nodeName) runs with the default 4-second timeout for text matching. This leaves a window where the correct node name may not be found before timeout, defeating the purpose of the 30-second window.

Apply the timeout directly to the text-matching operation:

Proposed fix
   return cy
-    .get(topologyPO.graph.nodeLabel, { timeout: 30000 })
-    .should('be.visible')
-    .contains(nodeName);
+    .contains(topologyPO.graph.nodeLabel, nodeName, { timeout: 30000 })
+    .should('be.visible');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return cy
.get(topologyPO.graph.nodeLabel, { timeout: 30000 })
.should('be.visible')
.contains(nodeName);
return cy
.contains(topologyPO.graph.nodeLabel, nodeName, { timeout: 30000 })
.should('be.visible');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/packages/topology/integration-tests/support/pages/topology/topology-page.ts`
around lines 292 - 295, The current chain uses a 30s timeout on
cy.get(topologyPO.graph.nodeLabel) but not on the subsequent text match, so
change the text match to use the explicit timeout; update the call that
currently does .contains(nodeName) to .contains(nodeName, { timeout: 30000 })
(or alternatively use cy.contains(topologyPO.graph.nodeLabel, nodeName, {
timeout: 30000 })) so the node label text matching shares the same 30s window.

@Leo6Leo
Copy link
Copy Markdown
Contributor

Leo6Leo commented Apr 15, 2026

Agree with coderabbit's comment, besides that lgtm. The failing backend ci seems just a flake. @sg00dwin

@sg00dwin
Copy link
Copy Markdown
Member Author

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 17, 2026

@sg00dwin: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console 9dd90e6 link true /test e2e-gcp-console

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/dev-console Related to dev-console component/knative Related to knative-plugin component/topology Related to topology 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants