Repository navigation
A failed presence check in the indicator driver should say what the page looked like - #10435
Merged
Merged
Conversation
…age looked like #10420 fixed the /hub, /train and /images loop: a hard 3000ms after each hard navigation, the only fixed budget in the file not derived from SETTLE_MS, which a contended macOS runner occasionally blew and then all three routes failed together. Measured incidence of that flake before the fix was 1 in 1831 step executions, the single occurrence being run 34070594239 attempt 1, which is 2.4 hours older than the fix. Two things it left behind. The same shape is still here once, at the collapsed-pill reload. A reload has to re-parse the bundle and re-read the stored preference before the pill can exist, exactly as /hub must before the card can, and it is followed by a fixed SETTLE_MS // 2 and a positive presence assertion with nothing in between. It has not failed, but only because 6000ms is double the budget that did; the structure is identical. It waits for the pill now. A scan for that specific shape across all 31 playwright_*.py found no other instance that can fail a suite. The other is that when a presence check does go the wrong way, all it prints is "FAILED: card survives /hub", which is the one thing already known. It now prints the states that separate the causes: pathname for a redirect or a route that never resolved, root_children for an SPA that never mounted, auth_token for a slip the /login guard in boot cannot catch mid-suite, show_pref for a preference that was not seeded, status_reads for a poll that never fired, and the console for a bundle that threw. Job logs here are kept about 26 hours, so a failure that explains itself in the log is the difference between a diagnosis and a rerun. The wait keeps swallowing its exception -- the caller's assertion is what decides pass or fail, and raising would turn a product verdict into a traceback that loses the remaining checks -- but it no longer swallows it anonymously. A TimeoutError means the card really was not there in the budget; a closed target means the run died for a reason that has nothing to do with the card, and those two were reported identically. It also surfaces a third outcome the old pairing hid: wait_for_selector waits for visible and count() counts attached, so a card that attaches and never becomes visible times out and passes. That is latent today, since the component returns null rather than rendering hidden, so this only logs a NOTE and changes no verdict. Not exercised end to end here: this box is Linux, so a playwright webkit install is WebKitGTK rather than the WebKit the Mac job drives, and the driver also needs a built frontend and a running studio. What did run: py_compile, the repo's 23 meta-tests over the playwright suites, the kwarg-spacing check, and a stub-page unit test of the two new helpers covering the timeout, dead-browser, /login redirect and collapsed-pill cases. The Mac job is the real check.
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. |
`Runtime.status_reads` counts every read since boot, so the raw total said nothing about the page that just failed: a route whose poll never fired still reported whatever boot and the earlier routes had accumulated, which is the one cause this probe was added to expose. Each navigation now takes the count before it and the report names the reads that navigation issued, scoped the same way `console_errors` already is. The total is kept alongside, since it is the thing to compare against when the delta looks plausible. Exercised directly, since the driver needs a built frontend and a running studio: a page issuing no reads with 7 behind it reported `status_reads=7` before this and reports `0 (of 7 since boot)` now, against `3 (of 10 since boot)` when the poll did fire.
Member
Author
|
@codex security review |
Naming what ended a wait is pointless if the next line re-raises it. A closed target or a navigation error fails `await_selector`, which records the name, and then fails `locator.count()` the same way, so the caller never reached its `check()` and the detail it had just collected was replaced by the traceback this change exists to avoid. Both presence checks did this. `counted` returns None when the page cannot be asked, and None is not zero: zero is a page that answered and had no card, None is a page that could not answer, and only the first is a verdict about the card. The probe block reports `<unreadable>` for the same reason, rather than a number standing in for an answer it never got. Exercised against a page that raises on every call: the old line raised and printed nothing, and the check now runs and reports `wait=Closed: Target page, context or browser has been closed`.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…age looked like (unslothai#10435) * A failed presence check in the indicator driver should say what the page looked like unslothai#10420 fixed the /hub, /train and /images loop: a hard 3000ms after each hard navigation, the only fixed budget in the file not derived from SETTLE_MS, which a contended macOS runner occasionally blew and then all three routes failed together. Measured incidence of that flake before the fix was 1 in 1831 step executions, the single occurrence being run 34070594239 attempt 1, which is 2.4 hours older than the fix. Two things it left behind. The same shape is still here once, at the collapsed-pill reload. A reload has to re-parse the bundle and re-read the stored preference before the pill can exist, exactly as /hub must before the card can, and it is followed by a fixed SETTLE_MS // 2 and a positive presence assertion with nothing in between. It has not failed, but only because 6000ms is double the budget that did; the structure is identical. It waits for the pill now. A scan for that specific shape across all 31 playwright_*.py found no other instance that can fail a suite. The other is that when a presence check does go the wrong way, all it prints is "FAILED: card survives /hub", which is the one thing already known. It now prints the states that separate the causes: pathname for a redirect or a route that never resolved, root_children for an SPA that never mounted, auth_token for a slip the /login guard in boot cannot catch mid-suite, show_pref for a preference that was not seeded, status_reads for a poll that never fired, and the console for a bundle that threw. Job logs here are kept about 26 hours, so a failure that explains itself in the log is the difference between a diagnosis and a rerun. The wait keeps swallowing its exception -- the caller's assertion is what decides pass or fail, and raising would turn a product verdict into a traceback that loses the remaining checks -- but it no longer swallows it anonymously. A TimeoutError means the card really was not there in the budget; a closed target means the run died for a reason that has nothing to do with the card, and those two were reported identically. It also surfaces a third outcome the old pairing hid: wait_for_selector waits for visible and count() counts attached, so a card that attaches and never becomes visible times out and passes. That is latent today, since the component returns null rather than rendering hidden, so this only logs a NOTE and changes no verdict. Not exercised end to end here: this box is Linux, so a playwright webkit install is WebKitGTK rather than the WebKit the Mac job drives, and the driver also needs a built frontend and a running studio. What did run: py_compile, the repo's 23 meta-tests over the playwright suites, the kwarg-spacing check, and a stub-page unit test of the two new helpers covering the timeout, dead-browser, /login redirect and collapsed-pill cases. The Mac job is the real check. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Report the status reads this page issued, not the total since boot `Runtime.status_reads` counts every read since boot, so the raw total said nothing about the page that just failed: a route whose poll never fired still reported whatever boot and the earlier routes had accumulated, which is the one cause this probe was added to expose. Each navigation now takes the count before it and the report names the reads that navigation issued, scoped the same way `console_errors` already is. The total is kept alongside, since it is the thing to compare against when the delta looks plausible. Exercised directly, since the driver needs a built frontend and a running studio: a page issuing no reads with 7 behind it reported `status_reads=7` before this and reports `0 (of 7 since boot)` now, against `3 (of 10 since boot)` when the poll did fire. * Let a page that cannot be asked still reach its own diagnostic Naming what ended a wait is pointless if the next line re-raises it. A closed target or a navigation error fails `await_selector`, which records the name, and then fails `locator.count()` the same way, so the caller never reached its `check()` and the detail it had just collected was replaced by the traceback this change exists to avoid. Both presence checks did this. `counted` returns None when the page cannot be asked, and None is not zero: zero is a page that answered and had no card, None is a page that could not answer, and only the first is a verdict about the card. The probe block reports `<unreadable>` for the same reason, rather than a number standing in for an answer it never got. Exercised against a page that raises on every call: the old line raised and printed nothing, and the check now runs and reports `wait=Closed: Target page, context or browser has been closed`. --------- 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.
Follow-up to #10420, which fixed the
/hub,/train,/imagesloop. Two things it left behind.What the flake actually was
Measured across every
Loaded-models indicator (WebKit)step execution from 2026-08-25 to 2026-09-07: 1 failure in 1,831 (0.055%). The single occurrence is run 34070594239 attempt 1 (job 101587088024, PR #10409, head83a5db2cf), which printed35/38with all three routes failing together. Attempt 2 hid it fromgh run list, which made it look more frequent than it was.git merge-base --is-ancestor fb9bb4ea0 83a5db2cfis false, and the step ran 04:08-04:26Z, about 2.4 hours before #10420 landed.Worth recording since it shaped the method: job logs in this repo are retained about 24-26 hours and return
410 Goneabove that, so the full-window figure comes from step exit statuses (valid becauserun-studio-indicator-browser.shisset -euo pipefailending on the driver, with nocontinue-on-error), and the log-level check covers only the ~28h that survives. That retention is also the argument for the second half of this PR.The same shape is still here once
tests/studio/playwright_loaded_models_indicator.py:572-574on main:Hard navigation, fixed budget, positive presence assertion, nothing in between. A reload has to re-parse the bundle and re-read
unsloth_loaded_models_collapsedbefore the pill can exist, exactly as/hubhas to before the card can. It has never failed, but only because 6000ms is double the budget that did. It waits for the pill now, and still fails if the collapse genuinely did not survive.A detector for that specific shape (nav -> fixed sleep -> positive presence assert, with no intervening
wait_for_selector/expect/wait_for_load_state) over all 31playwright_*.pyfound exactly one other hit,playwright_chat_ui.py:1854, which is a conditional branch rather than an assertion and cannot fail a suite. The heaviest users ofwait_for_timeout--playwright_chat_ui.py(40),playwright_find_in_page.py(40),playwright_nonmodal_menus.py(38) -- carry no instance. That is a targeted scan, not a full audit.A failure should explain itself
The whole output of the one real occurrence was:
which is the one thing already known.
check()already takes adetail; the presence checks now pass one:Each probe separates a different cause:
pathnamea redirect or a route that never resolved,root_childrenan SPA that never mounted,auth_tokena slip the/loginguard inbootcannot catch on a mid-suite navigation,show_prefa preference that was not seeded,status_readsa poll that never fired,consolea bundle that threw. Console messages are recorded rather than printed, cleared per navigation, capped at 200 chars each and the last 4 shown, so a passing run stays exactly as quiet as it is now.On swallowing the wait
The exception still must not propagate: the caller's presence assertion is what decides pass or fail, and raising would turn a product verdict into a traceback that loses the remaining checks. But
except Exception: passswallowed it anonymously, merging two unrelated outcomes. ATimeoutErroris a real verdict about the card. A closed target or navigation error means the run died for a reason with nothing to do with the card, and was reported identically asFAILED: card survives /hub.await_selectorreturns the class and first line so the detail can say which.It also surfaces a third outcome the old pairing hid entirely:
wait_for_selectorwaits for visible,count()counts attached, so a card that attaches and never becomes visible times out and passes. Latent today, sinceloaded-models-indicator.tsx:246returnsnullrather than rendering hidden, so this logs aNOTEand changes no verdict.One budget deliberately left alone
:591and:605wait 11,000ms for a card to appear or reopen via the 5s poll. Genuinely poll-bound, so a fixed wait is defensible, and:591asserts absence, which a selector wait cannot express. 11s is only ~2.2 ticks, so it is the next candidate if anything there ever flakes; not changed here because nothing has.Validation
Not exercised end to end. This box is Linux, so a
playwright install webkitgives WebKitGTK rather than the macOS WebKit the job drives, and the driver also needs a built frontend and a running studio. What did run:python -m py_compileon the driverpytest tests/studio/test_playwright_suites_run_in_ci.py tests/studio/test_indicator_browsers_run_in_parallel.py-> 23 passedpytest tests/test_enforce_kwargs_spacing.py-> 62 passedwhy_no_card/await_selectorcovering the timeout, dead-browser,/loginredirect and collapsed-pill casesThe Mac job on this PR is the real check.