[backport v2.14.5] [Automation] - Fix flaky login landing page tests - #18678
Open
izaac wants to merge 2 commits into
Open
[backport v2.14.5] [Automation] - Fix flaky login landing page tests#18678izaac wants to merge 2 commits into
izaac wants to merge 2 commits into
Conversation
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
requested review from
IsaSih,
MSpencer87,
ShylajaDevadiga,
a-arias and
yonasberhe23
August 5, 2026 22:51
Contributor
|
🔄 Auto-Retry Failed Run The Tests workflow failed for the commits below and has been automatically retried.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
401while 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
401to the firstGET /v1/userpreferencesafter 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:
Technical notes summary
Updated
cypress/e2e/tests/pages/user-menu/preferences.spec.ts:cy.location('pathname', MEDIUM_TIMEOUT_OPT)) to allow asynchronous preference fetching and SPA store state updates to resolve cleanly after login./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
@userMenusuite against a freshly provisioned Rancher on this branch:pages/user-menu/preferences.spec.tspages/user-menu/account-api-keys.spec.tspages/user-menu/logout.spec.ts20/20 passed with no retries, including the three affected tests:
Can select login landing page - home pageCan select login landing page - last visited(qa-tasks#2455)Can select login landing page - specific cluster(qa-tasks#2456)Checklist
Admin,Standard UserandUser Base