WIP: Fix flaky e2e-gcp-console secrets tests and SecretData React bug#16710
WIP: Fix flaky e2e-gcp-console secrets tests and SecretData React bug#16710perdasilva wants to merge 2 commits into
Conversation
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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: perdasilva The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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>
|
/retest |
1 similar comment
|
/retest |
|
@perdasilva: The following test failed, say
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. |
|
@perdasilva, FYI, the Cypress secrets tests are being migrated to Playwright with #16522. cc: @Cragsmann |
Summary
The
e2e-gcp-consoleCI job has had a 0% pass rate since Feb 2026 (186 builds analyzed). The dominant recent failure mode is flaky timeouts in thecrud/secretsCypress 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
SecretDatacomponent —setStatewas being called insideuseMemoinconfigmap-and-secret-data.tsx, violating React's expectation thatuseMemocallbacks are pure. ThehasRevealableContentstate variable also had a stale closure bug (missing from the dependency array). Fixed by computinghasRevealableContentas a derived value alongsidedataDescriptionListin a singleuseMemo, eliminating the separateuseStateentirely.Increase Cypress timeout and retries —
defaultCommandTimeoutincreased from 30s to 40s,retries.runModefrom 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 wait —
detailsPageIsLoaded()helper now waits for[data-test="secret-data"]to exist, ensuring the K8s API response has arrived andSecretDatahas rendered before tests interact with the page. Also consolidatedkey-value.cy.tsto use this helper instead of duplicating the checks inline.Test plan
e2e-gcp-consoleCI job passes on this PR🤖 Generated with Claude Code