Repository navigation
Multi-account Playwright: an aborted /login must not use up the stalled-load retry - #16768
Conversation
|
@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. Hooray! 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
…b cannot break it (#16784) ## Summary #16768 added `tests/studio/test_playwright_multi_account_open_login.py`, and all 7 of its tests fail in `Repo tests (CPU, studio)` when an earlier test in the same worker has stubbed Playwright, for example the staging run for #16613: ``` test_a_redirect_that_already_loaded_login_is_used E RuntimeError: playwright is not installed: Error needs a real browser E TypeError: catching classes that do not inherit from BaseException is not allowed test_a_second_failure_of_the_same_kind_is_real[two aborts] E TypeError: Expected a BaseException type, but got 'function' 7 failed, 10029 passed ``` The CPU jobs do not install Playwright. `tests/studio/test_heavy_thread_measurement_integrity.py` handles that by putting a stub `playwright.sync_api` into `sys.modules` that answers every name with a function that raises. My test guarded with `pytest.importorskip("playwright.sync_api")`, which finds that stub, so it ran with functions where it expected exception types. Run alone, or with real Playwright installed, it passed, which is why #16768's own checks were green. ## Change `tests/studio/test_playwright_multi_account_open_login.py` only. The test no longer imports Playwright. It defines `Error` and `TimeoutError(Error)` itself, matching Playwright's own hierarchy, and while loading the driver it puts a minimal `playwright.sync_api` carrying them into `sys.modules` through `monkeypatch`, which restores the previous modules after each test. The test now runs, rather than skips, on the CPU jobs, whatever earlier tests left behind. The driver and the test cases are unchanged. ## Testing With Playwright made unimportable and `test_heavy_thread_measurement_integrity.py` run first in the same process, as on CI: | | result | |---|---| | main | 7 failed, 76 passed (the errors above) | | this branch | 83 passed | - With the real Playwright installed: 7 passed. - Against the driver from before #16768: 3 failed, so the test still guards the abort and timeout budgets.
Summary
Chat UI Tests (extra)fails on unrelated PRs several times a day at the same place, for example #16722, #16741 and the staging run for #16750:#16437 added a recorded retry for exactly this stalled
/loginload, but it never runs in these failures. None of the failing logs print itsWARN: /login did not fire load ...line, and the whole step lasts about 33 s, i.e. one 30 s timeout.open_logingives aborts and timeouts one shared two-attempt budget: right after a log-out the app's own 401 redirect (redirectToAuth) aborts the firstgotowithERR_ABORTED, which spends attempt 1, and the stalled load then happens on attempt 2, where it is fatal.Change
tests/studio/playwright_multi_account.py,open_loginonly:/login, the page is used as it is instead of navigating to/logina second time. A redirect that ends anywhere else (for example/change-password) still navigates to/login.Nothing outside this Playwright driver changes.
tests/studio/test_playwright_multi_account_open_login.pydrivesopen_loginwith a scripted page and the real Playwright error types:/login/change-password, load/loginTesting
test_a_timeout_after_an_abort_still_gets_its_retry, the sequence the CI logs show.tests/test_ci_repo_cpu_shards.py,tests/studio/test_playwright_suites_run_in_ci.pyandtests/studio/test_pwsh_calls_use_the_shared_runner.pypass.