Skip to content

Motion failure produces no expected study report #5138

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.widgets.test_motion::test_a_motion_failure_shows_beside_the_study_and_reaches_the_agent — macOS
browser = <render_harness.WatchedBrowser object at 0x10ddaedb0>
serve = <function serve.<locals>.go at 0x10f0fc400>

    def test_a_motion_failure_shows_beside_the_study_and_reaches_the_agent(browser, serve):
        page = open_page(
            browser,
            serve(
                leaf_page(
                    "Motion failures",
                    """<h1>Motion failures</h1>
    <lf-motion id="sketch" duration="1000" aria-label="A sketch that breaks past its start">
      <figure id="sketch-study"><svg viewBox="0 0 300 80" role="img" aria-label="Travel">
        <circle id="dot" cx="20" cy="40" r="10" /></svg></figure>
    </lf-motion>
    <lf-motion id="recording" duration="1000" aria-label="A recording that cannot play">
      <figure><video muted playsinline width="160" height="90" aria-label="Clip"></video>
      </figure>
    </lf-motion>""",
                    head='<script type="module" src="/page/draw.js"></script>',
                ),
                packages=("motion",),
                page_files={
                    "draw.js": """
    await customElements.whenDefined('lf-motion');
    document.getElementById('sketch').renderFrame = time => {
      if (time > 0) throw new Error('the frame broke');
    };
    """
                },
            ),
        )
        # A press the browser refuses to play says so in the clock's place, and the agent
        # hears why.
        page.evaluate(
            """() => { HTMLMediaElement.prototype.play = () =>
              Promise.reject(new DOMException('no source to play', 'NotSupportedError')); }"""
        )
        recording = page.locator("#recording")
        recording.locator(".lf-motion-play").click()
        expect(recording.locator(".lf-motion-clock")).to_have_text("Failed")
        expect(recording.locator(".lf-motion-play")).to_have_accessible_name("Play")
>       consume_browser_errors(page, "Playback failed: no source to play")

/Users/runner/work/leaf/leaf/tests/browser/widgets/test_motion.py:264: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

page = <Page url='http://127.0.0.1:55687/versions/v1.html'>
expected = ('Playback failed: no source to play',)

    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 #5351, which merged as 7f8047f. The test read its browser problems too early: lfDocumentLifetime.whenActive defers a widget failure's console report to a setTimeout, so it lands a task after the clock already shows "Failed". It now waits for the complete inventory with reported_browser_errors: one playback failure, plus three frame failures, one for each draw that threw. With the report's deferral widened by 300 ms, the old test fails with CI's assert ([]) and the new one passes. Linux CI passed on the PR. The next scheduled test-macos run is the after-fix evidence for the macOS job.

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