Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions tests/render_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,10 +1354,21 @@ def margins_laid_out(page):
The pending frame is not a fact to wait a frame for (`tests/CLAUDE.md`, "a fixed
number of animation frames only guesses"), so the work is run instead of guessed at.
Whether the observer schedules it at all is `test_render_margin.py`'s subject, not
that of a test reading the layout it produces."""
page.evaluate(
that of a test reading the layout it produces.

The module load is awaited from the driver rather than inside `page.evaluate`, which
takes no timeout in any binding: a preview that stalls on the way out would hold the
worker for the rest of the job step instead of failing in thirty seconds naming its
test. `SERVED_TIMEOUT_MS` is the same patience the payload's own probes carry.

The `true` is load-bearing, not the comma operator's leftover: `wait_for_function`
awaits a promise the predicate returns, but a falsy resolution ends the wait rather
than polling again, so a predicate handing back the layout's own result would return
at once and prove nothing."""
page.wait_for_function(
"() => import('/runtime/margin-layout.js')"
".then(({layoutMarginRows}) => layoutMarginRows())"
".then(({layoutMarginRows}) => (layoutMarginRows(), true))",
timeout=render_checks_model.SERVED_TIMEOUT_MS,
)


Expand Down
Loading