Skip to content

WIP: Fix flaky e2e-gcp-console secrets tests and SecretData React bug#16710

Open
perdasilva wants to merge 2 commits into
openshift:release-4.18from
perdasilva:fix/e2e-gcp-console-secrets-flake
Open

WIP: Fix flaky e2e-gcp-console secrets tests and SecretData React bug#16710
perdasilva wants to merge 2 commits into
openshift:release-4.18from
perdasilva:fix/e2e-gcp-console-secrets-flake

Conversation

@perdasilva

Copy link
Copy Markdown

Summary

The e2e-gcp-console CI job has had a 0% pass rate since Feb 2026 (186 builds analyzed). The dominant recent failure mode is flaky timeouts in the crud/secrets Cypress tests, blocking at least 10 PRs including several CVE fixes.

This PR addresses three root causes identified through build log analysis across the full job history:

  • Fix React anti-pattern in SecretData componentsetState was being called inside useMemo in configmap-and-secret-data.tsx, violating React's expectation that useMemo callbacks are pure. The hasRevealableContent state variable also had a stale closure bug (missing from the dependency array). Fixed by computing hasRevealableContent as a derived value alongside dataDescriptionList in a single useMemo, eliminating the separate useState entirely.

  • Increase Cypress timeout and retriesdefaultCommandTimeout increased from 30s to 40s, retries.runMode from 1 to 2. The CI environment provisions fresh GCP clusters per run, making API responses slower than the 30s timeout allows. Other tests in the suite already use 90s per-assertion timeouts for similar reasons.

  • Add explicit data-load waitdetailsPageIsLoaded() helper now waits for [data-test="secret-data"] to exist, ensuring the K8s API response has arrived and SecretData has rendered before tests interact with the page. Also consolidated key-value.cy.ts to use this helper instead of duplicating the checks inline.

Test plan

  • TypeScript compiles cleanly (no new errors in modified files)
  • ESLint passes (pre-commit hook ran successfully)
  • e2e-gcp-console CI job passes on this PR
  • Verify "Reveal values" button still works on the Secrets detail page
  • Verify secret CRUD operations work end-to-end

🤖 Generated with Claude Code

The e2e-gcp-console CI job has had a 0% pass rate since Feb 2026,
with crud/secrets test timeouts as the dominant recent failure mode.

- Fix React anti-pattern in SecretData: remove setState call from
  inside useMemo and compute hasRevealableContent as a derived value.
  The previous code had a stale closure bug (hasRevealableContent not
  in the useMemo dependency array) and violated React's expectation
  that useMemo callbacks are pure.

- Increase Cypress defaultCommandTimeout from 30s to 40s and retries
  from 1 to 2 for CI headless runs. The 30s timeout is insufficient
  for the CI environment where fresh GCP clusters are provisioned.

- Add explicit wait for secret-data element in detailsPageIsLoaded
  helper to ensure the K8s API response has been received and the
  SecretData component has rendered before tests interact with it.

- Use detailsPageIsLoaded helper consistently in key-value.cy.ts
  instead of duplicating the loading checks inline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 78ac48a9-fa63-4977-9aaf-29a53ef86820

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@openshift-ci openshift-ci Bot requested review from jhadvig and rhamilto July 3, 2026 08:29
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jul 3, 2026
@openshift-ci

openshift-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: perdasilva
Once this PR has been reviewed and has the lgtm label, please assign vojtechszocs 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 the kind/cypress Related to Cypress e2e integration testing label Jul 3, 2026
@perdasilva perdasilva changed the title Fix flaky e2e-gcp-console secrets tests and SecretData React bug WIP: Fix flaky e2e-gcp-console secrets tests and SecretData React bug Jul 3, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2026
Cherry-pick the guided tour dismissal from 4.19 commit 2b60b9e
("Re-enabled guided tour for admin perspective") and add source.cy.ts
stability fixes from 567b06b.

The guided tour modal was re-enabled for admin perspective but the
secrets e2e tests never dismissed it. When the modal appears after
login, it overlays the entire viewport and blocks all Cypress
interactions — causing timeout failures on whichever element the
test tries to click next. This is the primary reason e2e-gcp-console
passes on 4.19 but fails on 4.18.

Changes:
- Add guidedTour.close() after cy.login() in all secrets tests,
  image-pull-secret test, and demo-dynamic-plugin test
- Add project visit before navigation in source.cy.ts beforeEach
  to avoid wrong-project flakes
- Add secret cleanup in source.cy.ts afterEach to prevent leftover
  state between test runs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@perdasilva

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@perdasilva: 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 d2d0e33 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/core Related to console core functionality do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cypress Related to Cypress e2e integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant