Skip to content

Markdown document viewport test reads missing caption before measuring geometry #4094

Closed

Description

@leaf-agent

tests/browser/widgets/test_code_and_documents.py::test_document_readings_share_a_stable_viewport_and_keep_their_scroll[markdown-default-height] fails before it switches readings. Its first page.evaluate(geometry) throws Cannot read properties of null (reading getBoundingClientRect). The evaluation calls box(owner), then box(owner.querySelector("figcaption")), then measures the tablist. The stack points to the caption measurement.

The test only creates Preview and Source locators before this measurement; locator construction does not establish the drawn controls exist. Reproduce to distinguish an initial-readiness race from missing product DOM, and retain the viewport and scroll-preservation assertions. The HTML variant is absent from this run's failure summary.

Observed in CI run 40217569506 on commit 2148fd1d1ff763cf2cd78e1b61253828193624b6. This report session read the deciding CI diagnostic; it did not reproduce locally. Start with the focused test on current main and inspect earlier CI results before choosing a repair.

The same focused case(s) passed in the preceding push run 40214840234, on 3fa4fd3a21701031b91a85841bec5bdba0314eb1. Run 40217569506 is the first failure established here; a prior pass does not clear an intermittent defect.

Cause of a failure tracked in #3985.

Activity

  1. added
    tend-ci-cause
    on Oct 25, 2026
  2. leaf-agent commented on Oct 25, 2026

    @leaf-agent
    CollaboratorAuthor

    Reproduced on current main (7863de5c693ad13da8bbf6647889e00f2d197d64): the focused Markdown case fails at its first geometry measurement with the same missing-caption error. I have not established a safe fix, so this remains open.

    This needs investigation at the shared readiness boundary before adding a wait for the document’s tabs. open_page already calls the page’s readiness wait, whose contract permits reading final boxes. The document’s asynchronous highlighting and preview preparation extend getUpdateComplete; why that work can outlast the readiness wait is still unresolved. A wait for a particular widget here would conceal that discrepancy.

    Reproduction and evidence
    uv run pytest 'tests/browser/widgets/test_code_and_documents.py::test_document_readings_share_a_stable_viewport_and_keep_their_scroll[markdown-default-height]' -q -n0

    Result: 1 failed in 4.54s, Page.evaluate: TypeError: Cannot read properties of null (reading 'getBoundingClientRect'), at before = page.evaluate(geometry).

    I also read the original run’s deciding traceback and the preceding run 40214840234’s JUnit artifact: both document variants passed in that preceding run. An exploratory local run with additional DOM diagnostics and an explicit updateComplete await passed the existing viewport and scroll assertions, but the caption was already present at the diagnostic read, so that run does not establish which completion is missing. A small exploratory runtime check of an undeclared element’s initial asynchronous drawing held presentation correctly; it did not reproduce the browser failure. All exploratory edits were removed.

    @max-sixty: the remaining blocker is isolating the early completion in the declared widget’s startup/presentation path. I could not justify changing either the shared completion tracking or this test’s readiness requirement from the evidence gathered.

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