Repository navigation
Make two load-sensitive tests independent of execution speed - #1751
Merged
Merged
Conversation
Both failed in an everyday-gate run at load average ~200 and passed alone.
`page check` tokenizes only the page's stylesheet. The old test asserted that
the check finished within 10 s, but the check's wall time is mostly the
browser stage it starts, so a loaded machine took 17 s. The quadratic rule
scanner that the 10 s bound guarded is gone: tinycss2 has owned the CSS
grammar since it replaced leaf's hand-written scanners. What leaf still owns is what
it hands the tokenizer. The test now records every string tinycss2 tokenizes
during the check and asserts that none of them carries a megabyte data URI.
An inline style on the page proves the recording sees the check's own CSS.
Control: when `_presentation_errors` also feeds `parser.html` to
`css_rules`, the new assertion fails.
The shift watch counts a viewport resize as input even when a layout-shift
record arrives before the `resize` event. Chrome lays out a resized viewport
before it dispatches `resize`. On a busy machine, a record from an earlier
frame (here the shortcut bar's small move after a focus change) can reach
the watch's observer in that gap. The observer then read its pose at the new
size and reported the resize's own movement as "moved without input".
`test_page_thread_dismiss_and_resolve_share_the_metadata_row[False-2]` hit
this in about one of 18 loaded copies ("lf-threads-toggle moved without
input by (100, 0)px; the same frame moved lf-shortcut-more"). The page
behaved correctly; the watch blamed the wrong cause. The watch now treats a
change in `innerWidth`/`innerHeight` as the input fact. The observer checks
the size before it reads a pose, and the `resize` listener runs the same
check. The new
`test_a_resize_owns_its_layout_before_its_event_dispatches` holds the
`resize` event and the watch's frames so that Chrome's record of the resized
layout arrives in that gap. It fails on the previous watch with the same
signature (a right-aligned button "moved without input by (-400, 0)px; the
same frame moved p") and passes with the fix. Under the same load, 36 of 36
copies of both [*-2] parametrizations passed after the fix.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 4, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 5, 2026
…he shift watch a pre-scroll pose (#1790) Two tests failed under load and passed alone. Each failure traced to a definite cause, and neither fix is a retry or a longer wait. **`test_a_user_move_no_carrier_will_pick_up_messages_its_claude_code_session`** This test failed four times in loaded local runs, each time at `auth, user = messages("s1")` with `TypeError: cannot unpack non-iterable NoneType`. The comment posted after the "watcher" let go of its lease reached no one, because `wait_is_live` still read the lease as held. A flock belongs to the open file, and every copy of the descriptor shares it. The test holds the wait lease in the same process that runs the page server. The comment posted under the lease starts a thread-title `claude` subprocess about 6 ms before the test closes the lease. On macOS, CPython forks to start that subprocess, so the child holds a copy of the lease descriptor until its exec closes it. `lease.close()` closed only the parent's copy. If the forked child is held across the close, the test fails every time with the same error. The presence cache was not involved: the nudge decision reads presence fresh. The fix is at the primitive. `release_lease` now unlocks before it closes, which releases the open file whatever copies remain. Tests release their leases through `release_lease` instead of closing the descriptor. Any process that holds a lease and starts subprocesses had the same window, for example a page server releasing its lease while a title subprocess is starting. `flocked`, `page_locked` and the interaction log also unlock before they close. Those locks are blocking, so the window only delayed the next taker until the child's exec, and none of them gave a wrong answer. `test_a_released_lease_is_free_while_a_child_still_holds_its_descriptor` passes a lease descriptor to a live child and checks that the released lease reads free. It fails when `release_lease` only closes. **`test_native_anchor_scroll_retains_local_motion_proof[*-]`** This failed on attempt 1 of #1778, and in two other CI runs since #1705 rewrote it, with `textarea#field moved without input`. It is unrelated to #1751's resize ownership: the resize branch never ran. A traced CI run showed that the motion came from the test's setup scroll, not from the typing gesture. The page scrolled before the watch's first frame, so the watch's first pose already showed the anchor scrolled while the anchored field had not moved yet. Chrome moved the field one frame later and reported that as a layout shift whose only source was the field. The watch credits a portal's catch-up to scrolling only from a pose taken before the scroll. It had no such pose, so it reported the move, which was correct. The test now paints a frame before it scrolls. The watch registers its frame callback at document start, ahead of any callback the page adds, so that frame gives the watch the pre-scroll pose. In an A/B on CI runners under the same load, the old order failed 2 of 648 copies and the fixed order failed 0 of 648. An earlier traced run had failed 2 of 432 copies. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Both failed in an everyday-gate run at load average ~200 and passed alone.
page checktokenizes only the page's stylesheet. The old test asserted thatthe check finished within 10 s, but the check's wall time is mostly the
browser stage it starts, so a loaded machine took 17 s. The quadratic rule
scanner that the 10 s bound guarded is gone: tinycss2 has owned the CSS
grammar since it replaced leaf's hand-written scanners. What leaf still owns is what
it hands the tokenizer. The test now records every string tinycss2 tokenizes
during the check and asserts that none of them carries a megabyte data URI.
An inline style on the page proves the recording sees the check's own CSS.
Control: when
_presentation_errorsalso feedsparser.htmltocss_rules, the new assertion fails.The shift watch counts a viewport resize as input even when a layout-shift
record arrives before the
resizeevent. Chrome lays out a resized viewportbefore it dispatches
resize. On a busy machine, a record from an earlierframe (here the shortcut bar's small move after a focus change) can reach
the watch's observer in that gap. The observer then read its pose at the new
size and reported the resize's own movement as "moved without input".
test_page_thread_dismiss_and_resolve_share_the_metadata_row[False-2]hitthis in about one of 18 loaded copies ("lf-threads-toggle moved without
input by (100, 0)px; the same frame moved lf-shortcut-more"). The page
behaved correctly; the watch blamed the wrong cause. The watch now treats a
change in
innerWidth/innerHeightas the input fact. The observer checksthe size before it reads a pose, and the
resizelistener runs the samecheck. The new
test_a_resize_owns_its_layout_before_its_event_dispatchesholds theresizeevent and the watch's frames so that Chrome's record of the resizedlayout arrives in that gap. It fails on the previous watch with the same
signature (a right-aligned button "moved without input by (-400, 0)px; the
same frame moved p") and passes with the fix. Under the same load, 36 of 36
copies of both [*-2] parametrizations passed after the fix.