Skip to content

[backport v2.14.5] [Automation] - Fix flaky login landing page tests - #18678

Open
izaac wants to merge 2 commits into
rancher:release-2.14from
izaac:issue-2455-2.14
Open

[backport v2.14.5] [Automation] - Fix flaky login landing page tests#18678
izaac wants to merge 2 commits into
rancher:release-2.14from
izaac:issue-2455-2.14

Conversation

@izaac

@izaac izaac commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This is a backport of #18528 to release-2.14.

The commit applied cleanly, so the changes are the same as on master.


Summary

Fixes rancher/qa-tasks#2455
Fixes rancher/qa-tasks#2456

Occurred changes and/or fixed issues

After login the app fetches user preferences before evaluating the after-login-route redirect. A transient failure of that fetch (e.g. a 401 while the session token propagates right after login) is silently swallowed by the app, which then falls back to the home page terminally, failing the URL assertion.

Reproduced locally by replying 401 to the first GET /v1/userpreferences after login, which produced the exact CI failure signature.

Wait for the post-login redirect chain to settle, and if it landed on the home page:

  • for the regular landing flow, re-visit the root so a full app bootstrap fetches preferences again and re-runs the redirect
  • for the auth redirect flow, retry the whole timed-out flow once, since authRedirect only lives in the store

Technical notes summary

Updated cypress/e2e/tests/pages/user-menu/preferences.spec.ts:

  • Added settling logic (cy.location('pathname', MEDIUM_TIMEOUT_OPT)) to allow asynchronous preference fetching and SPA store state updates to resolve cleanly after login.
  • Added recovery handling: if a transient auth propagation delay causes an initial fallback to /home, the test retries the bootstrap flow cleanly before asserting the final target URL.

Test only changes, no product code affected.

Testing done

Ran the @userMenu suite against a freshly provisioned Rancher on this branch:

Spec Result
pages/user-menu/preferences.spec.ts 17/17 passed
pages/user-menu/account-api-keys.spec.ts 1/1 passed
pages/user-menu/logout.spec.ts 2/2 passed

20/20 passed with no retries, including the three affected tests:

  • Can select login landing page - home page
  • Can select login landing page - last visited (qa-tasks#2455)
  • Can select login landing page - specific cluster (qa-tasks#2456)

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

After login the app fetches user preferences before evaluating the
after-login-route redirect. A transient failure of that fetch (e.g. a
401 while the session token propagates right after login) is silently
swallowed by the app, which then falls back to the home page
terminally, failing the URL assertion.

Reproduced locally by replying 401 to the first GET /v1/userpreferences
after login, which produced the exact CI failure signature.

Wait for the post-login redirect chain to settle, and if it landed on
the home page:
- for the regular landing flow, re-visit the root so a full app
  bootstrap fetches preferences again and re-runs the redirect
- for the auth redirect flow, retry the whole timed-out flow once,
  since authRedirect only lives in the store

Fixes rancher/qa-tasks#2455
Fixes rancher/qa-tasks#2456
@izaac izaac added QA/None QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this labels Aug 5, 2026
@izaac izaac added this to the v2.14.5 milestone Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔄 Auto-Retry Failed Run

The Tests workflow failed for the commits below and has been automatically retried.
Follow up on a retried run through its link if needed.

Commit Workflow run Retried at
d0a745d 31054236363 2026-08-05 23:22 UTC

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

Labels

QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this QA/None

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant