Skip to content

test_a_heading_copies_the_link_to_the_section_it_opens: the heading link's copy button moves 50 px without input when the CPU is slowed #7389

Done

Description

@leaf-agent

tests/browser/test_render_heading_links.py::test_a_heading_copies_the_link_to_the_section_it_opens errors at teardown with a shift-watch finding: the heading link's copy button button#copy-button.button in #shadow-root in wa-copy-button.lf-icon-action.lf-heading-link.lf-ui.lf-anchor-view.lf-heading-link-shown moved without input by (0, -50)px; the same frame moved wa-copy-button….

Runs: ci run 45985477026 on 21c613f05 (push). In the finding's evidence, the button's rect goes from top: 70.5 (sample at 2724.7 ms) to top: 20.5 (2792.3 ms), paint at 2790.2 ms, with no scroll credit, no animation terms and no size propagation. So the whole 50 px move is residual, from a layout change that has no recorded cause.

Reproduction: on db508e5b8, the test passes 6 of 6 times when run alone (uv run pytest -n0 -q <node-id>). With --cpu-throttle 4 or --cpu-throttle 8 it errors 6 of 6 times with the same finding. Throttled at 4, it also errors 3 of 3 times on bdd164efe (before #7383) and 3 of 3 times on b008b0d73, whose CI run didn't show it. So it predates this run's commit range: a slow CPU exposes it, and an unlucky runner did on CI.

Next step: find which step of the test moves the shown link 50 px up between those two samples. The likely candidates are the location.href navigation to #rates%252Flimits, which focuses the section, and the hover onto the unaddressed heading. Then decide whether that move is one the user would see unprompted, or a carry the watch should credit.

Cause of a failure tracked in #7387.

Activity

  1. added
    tend-ci-cause
    on Nov 27, 2026
  2. leaf-agent commented on Nov 27, 2026

    @leaf-agent
    CollaboratorAuthor

    Fix open in #7390. The 50 px move comes from the location.href navigation: it scrolls the page so the section's heading moves from 72 to 22, and the shown link follows its heading through CSS anchor positioning, as it should. The shift watch gave that move no credit because it only recognised anchor(top) plus a single offset, and the link's top adds four terms to its anchor's edge. On an idle machine the copy click's rendering was still open and owned the scroll. Throttled, it had closed before the navigation.

    #7390 lets the watch credit any inset whose calc() sum adds the anchor's edge to an offset that reads no anchor. Before the change, the test errored every time at throttle 4. With it, the test passes at throttles 4, 6 and 8. A new case in the watch's own anchor-scroll test fails without the change. CI and landing are with the PR's landing workflow.

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