Skip to content

Returning failed comparison mark produces no expected report #5135

Closed

Description

@leaf-agent

The scheduled run 41432142330 records the following failing boundary. This is CI evidence, not a claim that the failure persists on current main or that its cause is established.

Reconcile current main, existing repairs and active work before reproducing. Diagnose the shared failing operation before choosing a fix; split ownership if reproduction establishes different mechanisms. Preserve the intended behavior from the originating changes and follow the repository’s focused verification, review and landing gates.

tests.browser.test_render_options_settled::test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparison — macOS
browser = <render_harness.WatchedBrowser object at 0x1195d1310>
serve = <function serve.<locals>.go at 0x11dc8c180>

    def test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparison(
        browser, serve
    ):
        """A tab strip whose render throws on its return reports that once
        and still paints the next comparison: the failed reading stands, not the failure."""
        first = SETTLED_PAGE.replace(
            '<lf-ask id="transport-decision">',
            '<lf-tabs id="views"><lf-tab id="decision" label="Decision">'
            '<lf-ask id="transport-decision">',
            1,
        ).replace(
            "</lf-ask>",
            '</lf-ask></lf-tab><lf-tab id="notes" label="Notes">'
            "<p>Notes.</p></lf-tab></lf-tabs>",
            1,
        )
        url = serve(first)
        _publish(
            serve.page_dir,
            2,
            first.replace("Lax cookie", "Gentle cookie"),
            "Revise the settled answer",
        )
        page = open_page(browser, url.replace("v1.html", "v2.html"))
        mark = page.locator('[aria-controls="decision"] .lf-tabdiff')
        compare_with(page, 1)
        expect(mark).to_have_text("Δ1")
        # Turn off the settled comparison while the tabs are away. Returning to that
        # changed reading throws once; the next comparison must still update its mark.
        page.evaluate("""() => {
            const views = document.getElementById('views');
            const render = views.render;
            views.render = function () {
              // Subscribe before the deliberate failure so the next comparison can
              // retry this same Lit element through its normal render boundary.
              render.call(this);
              delete this.render;
              throw new Error('the marks failed once');
            };
            window.detachedViews = views;
            views.remove();
        }""")
        compare_with(page, 1)
        page.evaluate("() => document.querySelector('main').append(window.detachedViews)")
        expect(page.locator("#transport .lf-settled-diff")).to_have_count(0)
        # The paint reports the failure, and nothing else does: no uncaught throw.
>       errors = consume_browser_errors(page, "the marks failed once")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/Users/runner/work/leaf/leaf/tests/browser/test_render_options_settled.py:125: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

page = <Page url='http://127.0.0.1:65471/versions/v2.html#decision'>
expected = ('the marks failed once',)

    def consume_browser_errors(page, *expected):
        """Consume the problems a test caused on one page, each of which must be one of
        `expected` (`is_problem`)."""
        assert expected, "expected browser problems cannot be empty"
        errors = take_browser_errors(page)
>       assert errors and all(
            any(is_problem(error, wanted) for wanted in expected) for error in errors
        ), shown(errors)
E       AssertionError: 
E       assert ([])

/Users/runner/work/leaf/leaf/tests/render_harness.py:1656: AssertionError

The full tracebacks are in that run’s pytest-results-* JUnit artifacts.

Cause of a failure tracked in #4225.

Activity

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

    @leaf-agent
    CollaboratorAuthor

    Fixed by #5352, which is merged (649db78). The page behaved correctly; the test read its error list too early. The failure screenshot from run 41432142330 shows the tab strip had drawn <lf-tabs> failed: the marks failed once. In the browser, #transport .lf-settled-diff disappears about 6 ms before the tab strip reports that failure. The test read page.lf_errors right after the mark disappeared, without another Playwright call, so it could read an empty list.

    The test now waits for that exact report with reported_browser_errors and still asserts one report naming the tab strip and the thrown message. It fails about once in 25 recorded runs and only on macOS, and it didn't fail on Linux even with the page slowed. So the next scheduled test-macos run is the after evidence. If it fails there again, the report for that run brings it back.

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