Repository navigation
Multi-account Playwright: retry the login page once when the app's own logout redirect aborts it - #15398
Merged
Conversation
…n logout redirect aborts it
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
added a commit
that referenced
this pull request
Nov 2, 2026
…/login load never fires (#16437) ## Summary `Unsloth UI CI` / `Chat UI Tests (extra)` failed on main after #16431 (run 41358447599, push `681111a2e2`) in the multi-account step: ``` File "tests/studio/playwright_multi_account.py", line 133, in run open_login(page) File "tests/studio/playwright_multi_account.py", line 60, in open_login page.goto(f"{BASE_URL}/login") playwright._impl._errors.TimeoutError: Page.goto: Timeout 30000ms exceeded. - navigating to "http://127.0.0.1:18894/login", waiting until "load" ``` The same failure, at the same line, hit run 41290526680 (`perf/r14-chat-search`) this morning. Until #16431, the chat width step failed first on most runs, so this step was not reached and the failure stayed hidden. Line 133 is the `open_login` that runs right after `log_out`. In the server log, `POST /api/auth/logout` returns 204 and `GET /login` returns 200 about 20 ms later. After that the server sees nothing from that tab for 30 s, until the driver's cleanup `DELETE /api/accounts/...`. The server answered the navigation, but the page's `load` event never fired. In the passing run on #16431's head, the same sequence fires load and the second tab opens 1.4 s later. ## What I could and could not pin down Locally, against a Studio built from current main, the driver passed 25 of 25 runs normally and 15 of 15 with Chromium throttled 8x. So I could not reproduce the stall itself. Asset requests are excluded from the request log, so the CI artifacts also do not say which request hung. What I could show is that one stalled request is enough to produce exactly the CI error. I held one of the login page's `/assets` chunks during that navigation, and main fails at line 133 with `Page.goto: Timeout 30000ms exceeded ... waiting until "load"`. Every chunk I tried (`tour-*.js`, `chat-*.css`, `stt-download-mirror-*.js`, `training-*.js`) is on the login page's critical path. So waiting for `commit` or `domcontentloaded` and then for the form would not help, and I did not do that. ## Change **`tests/studio/playwright_multi_account.py`:** `open_login` keeps its single retry on `ERR_ABORTED` (#15398) and now also retries once on a navigation timeout. Before retrying, it records: - the requests that were still unfinished; - `document.readyState` and the URL; - a screenshot. These go to a `WARN:` line in the step log and to `login-load-timeout.{json,png}` under `PW_ART_DIR`. A second timeout or abort still fails the step. The multi-account checks themselves (account switch, second tab reload, password change, per-account storage) are unchanged. **`.github/workflows/studio-ui-smoke.yml`:** the step sets `PW_ART_DIR=logs/playwright_multi_account`, and that directory is added to the extra job's artifact upload. The next stall will then name the request that hung. ## Testing All runs used a local Studio from this tree. "Stalled" means one `/assets` chunk was held during the post-logout navigation; "transient" holds the first request only, "persistent" holds every attempt. | Scenario | main | this branch | |---|---|---| | Transient stall | fails at line 133 with the CI error | `WARN` names the held chunk, retry passes, `PASS` | | Persistent stall | fails at line 133 | `WARN`, then the retry fails with `Page.goto: Timeout 30000ms exceeded` | | No stall | passes | 8 of 8 `PASS` | The persistent-stall row shows a login page that really cannot load still fails. - `tests/studio` workflow / playwright / artifact tests: 871 passed, 45 skipped. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.
Problem
Chat UI Tests (extra)fails intermittently intests/studio/playwright_multi_account.py, always at the same step: the/loginnavigation right after the test logs the owner out.Seen on #15294 (job 121303172631) and #15369 (job 121656269753). Neither PR touches auth, and other runs of the same job pass.
Why
log_out()revokes the token and clears it fromlocalStoragewhile the chat page is still open. The page's pending and polling requests then get 401, andredirectToAuthinfeatures/auth/api.tssends the page to/loginitself, at the same moment the test starts its own/loginnavigation. Whichever navigation loses is aborted, so the test fails withERR_ABORTEDeven though the page ends up on/login. A small local reproduction with independent timings did not hit the race, so I am not claiming the exact interleaving. The failing line and the error match this path.The product is right to redirect a logged-out page to
/login. What the test needs is to be on the login page; how it gets there doesn't matter.Fix
A small
open_login(page)helper is used for the two/loginnavigations that follow a log-out: the one at line 119 and the one insidelogin().ERR_ABORTEDonly, it waits for the page to settle and navigates once more.The assertions that follow (the username field, the setup code login and the account isolation checks) are unchanged, so this cannot pass a page that did not reach the login screen.
Verification
Against a local page with Playwright's own
route.abort("aborted"), which produces exactlynet::ERR_ABORTED:page.goto, 1 abortnet::ERR_ABORTED(the CI failure)open_login, 1 abort/loginopen_login, 2 abortsnet::ERR_ABORTEDopen_login, no abort/loginThe Playwright driver guards (
test_playwright_suites_run_in_ci.py,test_playwright_server_lifecycle.py,test_click_forced.py,test_playwright_brand_labels.py): 94 passed. ruff format and check are clean.