Skip to content

test: let seven browser-test waits take the suite's deadline - #5455

Merged
leaf-agent merged 1 commit into
mainfrom
fix/suite-deadline-waits
Nov 5, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/suite-deadline-waits

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_wait_takes_the_suites_deadline refuses a literal timeout anywhere in the suite. A deadline sized to the author's machine fails a correct product on a busy runner (tests/AGENTS.md, "Functional results do not depend on execution speed"). It has failed in the last two scheduled runs and on current main because of seven new literal timeouts:

None of these waits measures how long its subject takes, so each now takes SERVED_TIMEOUT_MS, the default that render_harness gives every wait that names none.

The lint test fails on main e0c0f9c5f and passes with this change. These tests also pass with it: test_a_control_an_authored_anchor_name_moves_into_a_pin_s_seat_moves_the_pin, test_a_page_s_reaction_to_a_runtime_mark_moves_a_pin_clear, test_a_pin_on_a_code_block_s_first_line_leaves_copy_pressable, test_a_row_in_content_skipped_until_near_stands_once_the_page_scrolls_to_it, test_recordings_a_revision_adds_join_the_studys_clock and test_a_tab_opened_while_closed_documents_draw_reports_its_document_at_once. test_a_comment_on_a_closed_tab_s_document_never_reads_as_earlier_data fails with and without this change: its thread quote is never found, the same failure as in push run 41976158322.

Refs #4225 — automated triage

test_a_wait_takes_the_suites_deadline refuses a literal timeout, since a
deadline sized to the author's machine fails a correct product on a busy
runner. #5359 added four (two pin-clearance waits in test_pins.py, Copy's
click and the withheld-row expectation in test_scrollers.py), #5399 one
(the motion study's shared clock) and #5371 two (the closed-tab document
attributes). Each now takes SERVED_TIMEOUT_MS, the default render_harness
gives every wait that names none; none of the waits times its subject.

Refs #4225
@leaf-agent
leaf-agent merged commit 3f01e2c into main Nov 5, 2026
5 of 6 checks passed
@leaf-agent
leaf-agent deleted the fix/suite-deadline-waits branch November 5, 2026 09:32
leaf-agent added a commit that referenced this pull request Nov 8, 2026
…5701)

The nightly journey `test_a_wait_takes_the_suites_deadline` has failed
since scheduled run
[42365682113](https://github.com/max-sixty/leaf/actions/runs/42365682113).
It found 24 waits with literal 2 s or 3 s timeouts, added by #5617
(`test_previews.py`, `test_charts.py`) and #5618
(`test_render_anchors.py`). This PR drops each `timeout=` argument, so
those waits take the suite's default deadline (`SERVED_TIMEOUT_MS`,
which `render_harness` sets). What each wait waits for doesn't change.
The literal values were sized to a fast machine, which is why the check
rejects them.

Verification on main `fcad5fa09`: the check fails before this change,
listing all 24 sites, and passes after it. The 19 browser tests that
hold those waits pass under `--run-main` (42 cases).

The same check went red for the same reason on Nov 5, and #5455 fixed
that. It's a 2–6 s static scan of the test sources, but it lives in
`tests/journeys/`, which only the scheduled run reaches. So a pull
request that adds a literal deadline passes its own CI, and main finds
out the next day. The durable fix is to run this check on every pull
request; I'm filing that separately.

Refs #4225 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 9, 2026
…r test module (#5735)

The literal-deadline, fixture-resource and SIGKILL rules each parsed
every module under `tests/` in one case, too slow for the `model/`
budget. So they sat in `tests/journeys/`, which only the scheduled run
reaches. A pull request that broke one merged green and turned main's
nightly red: #5455 and #5701 cleaned up literal deadlines, and #5684 a
fixture resource taken outside its fixture. The three tests now live in
`tests/model/test_suite_source.py`, keeping their names and rules, and
each is parametrized over the test modules. A case reads one module, so
the tier every pull request runs holds them.

Verified locally:
- `uv run pytest tests --collect-only` now collects 1056 cases (3 rules
× 352 modules). Before, broad discovery skipped all three tests.
- All cases pass on this head. A scratch module with `thread.join(5)`,
`timeout=1000`, `signal.SIGKILL` and a bare `Popen` fails all three
rules, and each finding names the module and line.
- Cost: the slowest case takes 0.29 s, well under the 3 s `model/`
budget. Total case time is about 11 s locally, against about 10 s for
the three old tests. CI's `test` job runs `-n 3`, so this adds a few
seconds of wall time to each pull request.

Each rule parses its module separately, which triples the parse work.
One test that applies all three rules to a single parse would cost about
8 s instead of 11 s. But `tests/AGENTS.md` and `interact_support.py`
cite these test names, and changing agent instructions needs a
maintainer's approval, so this PR keeps the names. Each finding of a
fixed deadline now names the constant that should bound the wait, since
the old one-off assertion message no longer exists.

Closes #5712 — automated triage

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant