Skip to content

Document scroll, feature-gallery quoting and a feature-gallery render-gate hang each fail once, only on macOS, in the Nov 22 full-tier dispatch #6807

Done

Description

@leaf-agent

These three tests failed only in the test-macos job of full-tier ci run 45073646401 on 3c9424f48 (a workflow_dispatch). The Linux test job ran them in the same run and passed them. The previous full-tier dispatch, 45044712114 on 89b4d28d8, passed all three on macOS. The range 89b4d28d8..3c9424f48 holds nine commits, and none of them obviously touches these paths. The failures haven't been reproduced or bisected. As running-tend's A red ci on main is live says, the next step is to dispatch each test alone on the macOS runner and see which fail every time.

Test Deciding error
tests/browser/widgets/test_code_and_documents.py::test_document_readings_share_a_stable_viewport_and_keep_their_scroll[html-authored-height] Page.wait_for_function: Timeout 120000ms exceeded at line 342, waiting for the source tabpanel's scrollTop > 0 after PageDown while that panel holds focus
tests/journeys/test_render_anchors.py::test_real_page_passages_can_be_quoted[feature-gallery] 1 passages in feature-gallery quote text the page can't find: ['“The current page replaces the old release plan. Its earlier quotation'], a passage that ends inside the agent's reply bg-retained-quote-reply in examples/developer/feature-gallery.jsonl
tests/journeys/test_render_gate.py::test_page_fixture_renders[feature-gallery] worker gw2 hit pytest's 30-minute timeout and crashed. At the timeout, the page server's thread was in samples.create → revisioning.activate_source → revision_artifact.capture_artifact → _capture_input_stamps, which walks the page's page/ and media trees with rglob

Two of the three run on feature-gallery. The sample-creation stack suggests that a live sample's POST stalled the render gate. That reading is unconfirmed: the dump shows where the thread was at one moment, not that it was stuck there.

Cause of a failure tracked in #6804.

Activity

  1. added
    tend-ci-cause
    on Nov 23, 2026
  2. added 2 commits that reference this issue on Nov 23, 2026
  3. leaf-agent commented on Nov 23, 2026

    @leaf-agent
    CollaboratorAuthor

    Two of the three failures reproduce on current main (017ddeccf) on the macOS runner. The quoting failure does not. None of them is fixed yet, and the issue stays open for the next diagnostic run.

    Test Dispatch on 017ddeccf Result
    test_document_readings_share_a_stable_viewport_and_keep_their_scroll[html-authored-height] 45097026810, --load 4 1 of 18 failed, same 120 s timeout waiting for the source panel's scrollTop > 0
    test_real_page_passages_can_be_quoted[feature-gallery] same run 18 of 18 passed
    test_page_fixture_renders[feature-gallery] 45097028853, 6 copies 1 of 6 hit pytest's 30-minute timeout

    Document scroll: the browser's PageDown glide on the source panel ends without moving. An instrumented copy (45102502610, 1 of 36 failed) recorded the panel just before and after the key press. Focus was on the source tabpanel. The panel could scroll: scrollHeight was 1448 and clientHeight 240. PageDown's keydown was not defaultPrevented. Even so, the panel fired a scrollend 260 ms later with scrollTop still 0, and no scroll event came before it. A scrollend with no scroll before it means the browser started the glide and something ended it before its first frame moved the box. A script that writes the panel's own position, as stopWhereItStands or a place keeper's restore in browser/runtime/arrivals.js and scrolling.js can, would end the glide this way. lf-text-document.js and lf-tabs.js never write the panel's scrollTop. Which code wrote it is still unknown. A follow-up run that hooked every scrollTop and scrollTo write on the panel to record its stack (45103731119) passed all 54 copies, so it caught no write. At about 1 in 27, 54 passes happen by chance about 13% of the time, so that run neither confirms the write nor rules it out.

    Render gate: the test waits on the page without end; the server isn't stuck. When the hung copy timed out, its page server was serving a live sample's request (http._sample_request → served_state.service.revision → revision_artifact.read_revision). In the original run's dump it was in revisioning.activate_source → capture_artifact. Two different frames, so the server is still working, and the "stall in _capture_input_stamps" reading in the report doesn't hold. Pytest's main thread was inside Playwright's event loop, and the greenlet hides which test call it was waiting in. Some step of the gate or a journey waits on the page with no timeout and never returns.

    Quoting: not reproduced in 18 copies under load. The one failure is still the only evidence.

    Next steps:

    • Scroll: run the write hook again with more copies. If it still catches nothing, also log scrollend on the page scroller and the iframe, to see whether a glide stopped elsewhere also stands the panel's glide down.
    • Render gate: run copies with a per-call Playwright timeout, so a hang fails at the call that waits instead of at pytest's 30-minute limit.

    The scratch branches have been deleted. The instrumentation was a page.evaluate that logs keydown, keyup, scroll and scrollend on the panel (and, in the second run, wraps Element.prototype.scrollTop's setter and scrollTo/scroll/scrollBy), placed just before the source panel's PageDown in tests/browser/widgets/test_code_and_documents.py.

  4. leaf-agent commented on Nov 23, 2026

    @leaf-agent
    CollaboratorAuthor

    No script stops the source panel's PageDown glide. The browser ends that glide on its own before the panel moves, and waiting for a rendering update before the press doesn't prevent it. Nothing is fixed yet, and the issue stays open because the scroll failure reproduces reliably enough to keep diagnosing.

    Dispatch on main + instrumentation Test Result
    45127427697, 108 copies, --load 4 document scroll [html-authored-height] 5 of 108 failed
    45127430980, 12 copies, --load 4 test_page_fixture_renders[feature-gallery] 12 of 12 passed
    45140596242, 108 copies, rendered(page) before PageDown document scroll 1 of 108 failed, same wait

    Document scroll. The 108-copy run hooked every scroll and focus write a script could make: the setters for scrollTop/scrollLeft, scrollTo/scroll/scrollBy/scrollIntoView on elements and on window, and focus. It also logged scroll/scrollend on the page and the iframe, mutations and resizes of the panel, and long animation frames with their script attribution. All five failures read the same way:

    • Focus is on the source panel, which can scroll (scrollHeight 1448, clientHeight 240). PageDown's keydown is not defaultPrevented.
    • No script writes any scroll position or focus, nothing mutates the panel, and nothing else on the page or in the iframe scrolls.
    • The panel fires scrollend 100 to 1200 ms later with scrollTop 0, and no scroll event comes before it.
    • The frame that holds the key press runs 260 to 1220 ms, mostly in requestAnimationFrame callbacks of 100 to 190 ms. After it the page keeps producing 50 to 130 ms frames, with no script in them, for the whole 15 s wait.

    So the earlier suspicion of stopWhereItStands or a place keeper's restore doesn't hold: Leaf's code never touches the panel. I next guessed that the press came before the compositor knew the newly shown panel could scroll. Waiting for rendered(page) between the focus and the press tests that guess, and it still failed 1 time in 108. The drop from 5 to 1 is within chance at these counts, so the guess is neither confirmed nor ruled out.

    What's still open:

    • Continuous frames. The page goes on rendering for 15 s with no script running and nothing scrolling. If something on this small page invalidates rendering every frame, it would explain the starved glide, and it would be a product cost of its own. The next run should log what changes each frame, such as running animations from document.getAnimations().
    • No baseline from passing copies. Their stdout isn't kept, so I can't yet compare them with the failures. The next run should write each copy's log to .tmp/flake/.

    Render gate. 0 of 12 this time, so 1 of 18 across both runs. The 12-copy run logged every Playwright call and reply to a file, so a hang would have named the call that never returned, but none hung. The one hang so far still has no location. The cheapest durable capture is to log the in-flight Playwright call when pytest-timeout fires, for every test in the suite, since the greenlet hides it from the stack dump.

    Quoting. Not run again. It is still 0 of 18 since the original failure.

    Instrumentation, for the next run

    The scroll probe was a page.evaluate placed between expect(source_panel).to_be_focused() and the source panel's PageDown in tests/browser/widgets/test_code_and_documents.py. It wrapped the element and window scroll setters and methods and HTMLElement.prototype.focus, recording each call's stack. It added capturing keydown/keyup/scroll/scrollend listeners on the panel, plus scroll/scrollend on document and the iframe's document, a MutationObserver and ResizeObserver on the panel, and a PerformanceObserver for long-animation-frame. The wait was cut to 15 s, and on timeout the test printed the log. The render-gate probe wrapped Transport.serialize_message and Connection.dispatch in playwright._impl and wrote SEND/RECV lines to .tmp/flake/pwcalls-<pid>.log. The scratch branches (repro/issue-6807-c, -d, fix/issue-6807) are deleted.

  5. leaf-agent commented on Nov 24, 2026

    @leaf-agent
    CollaboratorAuthor

    I'm closing this as waiting on a recurrence. None of the three failures has a step left that a session can take before its next failure. All three passed in scheduled run 45159811021 on c8ab9ec1d on both macOS and Linux. #6982 adds the dump the render-gate hang was missing, and tend-land has its CI and landing.

    Test Copies on the macOS runner so far What its next failure should show
    document scroll [html-authored-height] 8 of 432 failed across six dispatches. 0 of 108 failed in today's 45342415166 on 85d756311 whether a second PageDown scrolls the panel
    test_page_fixture_renders[feature-gallery] 1 of 18 hung with #6982, the stack of the test call it waits in
    test_real_page_passages_can_be_quoted[feature-gallery] 0 of 18 failed the passage it fails to find, which the existing message already prints

    Document scroll. Earlier runs showed that no Leaf script writes the panel's scroll position. The browser itself ends the PageDown glide before the panel moves. In 45127427697 the probe also attached a ResizeObserver to the panel, which reports its first size at the next rendering update. In the two failing copies I read, that report arrived 290 and 1110 ms after the key press, so no rendering update ran between focusing the panel and pressing the key. A starved main thread is the reading that fits. I haven't confirmed it, but the compositor may not yet know the newly shown panel can scroll.

    Today's dispatch tested that reading. When the first press didn't move the panel within 8 s, it pressed PageDown again. A second press that scrolls would mean the first was lost to timing, not that the panel can't be scrolled. No copy failed, so the run settled neither. Across all six dispatches the failure rate is about 1 in 54, so 108 straight passes happen by chance about 13% of the time. Once it recurs, apply that same re-press check to the failing copy.

    Render gate. The one hang left no location. faulthandler's dump only shows OS threads, and Playwright's sync API keeps the test's own frames in a suspended greenlet. After #6982 merges, the timeout's output will also carry each greenlet's stack, ending at the line whose call is waiting.

    Today's scroll probe, for the next run

    Put this between expect(source_panel).to_be_focused() and the source panel's PageDown in tests/browser/widgets/test_code_and_documents.py. It is a page.evaluate that logs scroll, scrollend and keydown on the panel, plus the panel's scrollTop on every animation frame. The wait for scrollTop > 0 is cut to 8 s. On timeout, the probe presses PageDown again, waits 8 s more, and fails with DBG6807 first PageDown lost; SECOND-PRESS-SCROLLED or SECOND-PRESS-STILL-ZERO, printing the log. The per-frame requestAnimationFrame loop makes the page render every frame, and that may have hidden the failure itself. A next probe should drop that loop. The scratch branch repro/issue-6807-e is deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions