Stop the banner layout suite waiting out the update timer on every boot by danielhanchen · Pull Request #9105 · unslothai/unsloth · GitHub
Skip to content

Stop the banner layout suite waiting out the update timer on every boot - #9105

Merged
danielhanchen merged 2 commits into
mainfrom
banner-update-check-delay
Aug 18, 2026
Merged

Stop the banner layout suite waiting out the update timer on every boot#9105
danielhanchen merged 2 commits into
mainfrom
banner-update-check-delay

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Update banner layout regression is the largest step in Chat UI Tests at 4.98 of the job's 17.6 minutes, and the second banner step adds 2.27 more. Together that is 41% of a job that runs on Linux, Windows and macOS.

Where the time goes

The suite boots a fresh page for each case it measures, and the card it is measuring is mounted by the app's 5s update-check timer, so wait_for_selector on it cannot return sooner than that. At 33 boots the timer alone is over two and a half minutes.

The rest of each boot is the 900ms animation settle and settle_stack, both of which are render waits, and both are left exactly as they are. Measured earlier as 33 gaps of about 7.5s: 5 for the timer, 0.9 for the settle, roughly 1.6 of stability polling. The stability poll is converging rather than exhausting, so it is not the thing to change.

The change

The delay becomes overridable from a global that the hook reads at mount, and the suite sets it in the init script it already installs, to 150ms. Not zero, because a card that mounts on the first frame would stop exercising the late-mount reflow this file exists to measure.

Production is untouched: the global is undefined in every real browser and the 5000ms constant stands. It is a global rather than an env var specifically so that no build can bake the shortened delay in.

Why there is a test for a two-line change

The two sides are connected by nothing but the spelling of the global, and a typo on either would fail in the worst way available: the timer quietly stays at 5s, the step goes back to being slow, and every assertion still passes. tests/studio/test_banner_update_delay_override.py asserts the spelling matches, that the suite sets it before the app runs rather than after navigation, and that the production constant is still 5000.

Update banner layout regression is the largest step in Chat UI Tests at 4.98 of
the job's 17.6 minutes, and the second banner step adds 2.27 more. Together that
is 41 percent of a job that runs on Linux, Windows and macOS.

Where it goes: the suite boots a fresh page for each case it measures, and the
card it is measuring is mounted by the app's 5s update-check timer, so
wait_for_selector on it cannot return sooner than that. At 33 boots the timer
alone is over two and a half minutes. The remaining per-boot time is the 900ms
animation settle and settle_stack, both of which are render waits, both of which
this leaves exactly as they are. Measured earlier as 33 gaps of about 7.5s each,
which is 5 for the timer plus 0.9 plus roughly 1.6 of stability polling: the
stability poll is converging, not exhausting, so it is not the thing to change.

So the delay becomes overridable from a global that the hook reads AT MOUNT, and
the suite sets it in the init script it already installs, to 150ms. Not zero: a
card that mounts on the first frame would stop exercising the late-mount reflow
this file exists to measure. Production is untouched, since the global is
undefined in every real browser and the 5000ms constant stands, and it is a
global rather than an env var so no build can bake the short delay in.

The two sides are connected by nothing but the spelling, and a typo on either
would fail in the worst way available: the timer quietly stays at 5s, the step
goes back to being slow, and every assertion still passes. The new test asserts
the spelling, that the suite sets it before the app runs rather than after
navigation, and that the production constant is still 5000.
@danielhanchen
danielhanchen merged commit 019ede7 into main Aug 18, 2026
35 of 39 checks passed
@danielhanchen
danielhanchen deleted the banner-update-check-delay branch August 18, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant