Repository navigation
Commit 8bf0a0b
authored
Bound the margin layout wait so a stalled module fails the test, not the job (#154)
## Problem
The review on #153
([review](#153 (review)))
raised this while that PR was in flight; it merged before the point was
actioned, so the shape is on `main` now. `margins_laid_out` awaits the
`/runtime/margin-layout.js` import inside `page.evaluate`, which
`tests/CLAUDE.md` names as the unbounded case: "`page.evaluate` takes no
timeout in any binding, so a promise awaited inside it — an animation's
`finished`, a module's load, a listener's next call — is a wait nothing
bounds. It does not fail in thirty seconds naming its test: it spends
the job's whole step, and the share of the suite already handed to that
worker never runs."
That is the class #84 and #95 bound at eleven other sites; this helper
was added after them and reintroduces it at three call sites —
`test_render_pages.py` twice and `test_render_margin.py` once — all of
them on the render suite's ordinary path.
## Solution
Poll the import from the driver with `wait_for_function` against
`render_checks.SERVED_TIMEOUT_MS`, the same patience the payload's own
probes carry. The deadline moves to the driver side, which is the shape
`tests/CLAUDE.md` prefers; the round trip count and the frame the layout
runs in are unchanged. The docstring now says why the wait is bounded
from outside, so the next reader does not have to re-derive it.
## Testing
On this branch, rebased on `6d68a1b`:
- `uv run pytest tests` — 740 passed, 6 skipped. That is the gate CI
runs on this PR.
- `uv run pytest
tests/test_render_pages.py::test_a_left_sidebar_uses_the_margin_until_the_page_needs_it_back
--run-nightly -n0` — passes. This is the test #153 fixed, and the one
the helper was written for.
- `uv run pytest tests/test_render_margin.py tests/test_render_pages.py
--run-nightly -n2` — 62 passed, 2 failed. Both failures are pre-existing
and untouched here (below).
- `ruff check` and `ruff format --check` over the changed file pass.
<details><summary>The two nightly failures, and why they are not this
change</summary>
`test_render_margin.py::test_g_addresses_the_page_map_prefix_in_its_announced_order`
and
`test_one_margin_item_owns_a_targets_controls_information_and_more_actions`
both wait for `m\s*page-map items` on the key line and read
`gm1–9page-map items` / `gm1–4page-map items` instead. I reran both at
`-n0` with this diff stashed, on `6d68a1b` unmodified: they fail
identically. They belong to `aa41f7a` ("Keep chord hints stable through
progress"), which changed the chord row to carry the item count, and
#153's body already named them on its own base. No open issue tracks
them yet; the next `ci` on `main` should route them to `tend-ci-fix`.
</details>
---------
Co-authored-by: leaf-agent <[email protected]>1 parent b4a5aeb commit 8bf0a0b
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1354 | 1354 | | |
1355 | 1355 | | |
1356 | 1356 | | |
1357 | | - | |
1358 | | - | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1359 | 1369 | | |
1360 | | - | |
| 1370 | + | |
| 1371 | + | |
1361 | 1372 | | |
1362 | 1373 | | |
1363 | 1374 | | |
| |||
0 commit comments