Skip to content

Drop test checks for classes nothing emits, and point five comments at current code - #5601

Merged
max-sixty merged 2 commits into
mainfrom
nightly/stale-pointers
Nov 6, 2026
Merged

max-sixty merged 2 commits into
mainfrom
nightly/stale-pointers

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Four tests in tests/browser/startup/test_freshness.py slept for a fixed time and then checked that something had not happened: the page asking for state, reloading, or looking for news while hidden. On a slow machine the unwanted request or reload can arrive after the sleep, so the test passes with the bug present. That breaks the rule in tests/AGENTS.md, "Absences", and #5541's sweep missed this file. Each check now waits for something the page itself does after the moment it would have misbehaved. The page counts its own requests (COUNT_ASKS, moved to the top of the file). Each rewritten check failed with the bug it guards against planted in browser/runtime/state-feed.js, and all twelve tests in the file pass without it.

Test Slept Now waits for Planted fault it caught
test_a_quiet_page_reads_only_freshness_and_hears_changes 3 s a round of the shared clock, then a freshness check the page finished the clock asking for state every round (asks = true || …)
test_a_durable_server_restart_keeps_the_current_editor 500 ms the page's next freshness check after the one that saw the new server, or a reloaded document, whichever comes first a reload 100 ms after seeing the new server
test_a_hidden_page_stops_its_freshness_reads_until_it_is_visible 500 ms a round of the shared clock; it now also checks that no freshness request was sent after the page hid a hidden page that keeps checking (stopListening not called)
test_a_page_whose_read_failed_asks_again_on_its_own 1 s eight freshness checks; it then allows one state read per round of the clock, timed by the page's own clock, plus one every check asking for state (if (true) item(observed)), which made 9 reads in about 2 s

ran_its_clock has the page set a timer one interval of the shared clock long (TICK_MS, plus 500 ms). The browser fires timers in deadline order, so the clock's next round and any freshness check still scheduled run before it, however slowly the machine runs them. A fixed sleep, by contrast, runs on the test's clock, which knows nothing about the page's timers. TICK_MS is copied from state-feed.js, and a comment says so.

The 100 ms sleep before the hidden-page test writes its news is left in place: it is setup, not a check that something stayed absent.

…t current code

Seven browser and journey checks asserted that a class nothing in the runtime
writes any more has no element: `.lf-fp-context` (gone since #3634),
`.lf-composer-row`, `details.lf-details`, `.lf-summary-refold`, `.lf-toast` (twice)
and the `.lf-margin-layer` member of a selector union. Each held whatever the code
did, so they go; `test_render_read_state`'s `_said` reads the peek it was already
reading alone. The behaviour each test protects stays checked by its other
assertions.

Comments that named what is gone:

- `user_views.py` said `page state` publishes `viewed_at`; the field is `viewed`.
- `test_activity.py` pointed at a copy test deleted with the static export (#1136).
- `test_render_margin.py` kept a comment whose constant was removed.
- `dev/pyproject.toml` placed the eval harnesses in `notes/`; they are in `evals/`.
- `arrangement_eval.py` said both judges count reachability; only the pairwise
  judge (`regrade.yaml`) interpolates it now.
… page's title

The live-keys page holds one obligation, so since #5591 its tab reads
"(1) Live keys second" after the revision; the test still expected the bare title
and timed out on it. The revision the assertion waits for is unchanged.
@max-sixty
max-sixty merged commit ecf7065 into main Nov 6, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the nightly/stale-pointers branch November 6, 2026 17:36
leaf-agent added a commit that referenced this pull request Nov 7, 2026
…5631)

Eight browser and journey tests have failed on main since #5591, which
counts On me at the front of the tab's title while it is above zero.
Each asserts a page's title after a revision or a delivery, and each
fixture holds an open obligation, so the tab now reads `(1) Live keys
rewritten` (or `(2) Widgets second`) where the test expected the
authored title alone. #5601 already updated one such assertion in
`test_current_location.py`; this updates the eight it left, to the count
each fixture holds. No runtime code changes.

The tests fail on `903e1d106` with `Page title expected to be 'Live keys
rewritten' Actual value: (1) Live keys rewritten`, and all eight pass
with this change (`uv run pytest -n 4` over the eight node ids, 8
passed). The first push run that shows them failing is
[42162679091](https://github.com/max-sixty/leaf/actions/runs/42162679091),
the first completed run after #5591 merged; scheduled run
[42205827418](https://github.com/max-sixty/leaf/actions/runs/42205827418)
shows them too.

<details><summary>Tests updated</summary>

- `tests/browser/projection/test_current_location.py`:
`test_a_revision_that_restates_an_obligation_preserves_the_users_location_in_it`,
`test_a_restated_obligation_returns_a_user_to_the_question_not_to_a_control`,
`test_a_revision_gives_back_what_the_user_moved_and_nothing_they_left`,
`test_a_revision_that_rewrites_a_draft_leaves_the_user_where_they_stand`,
`test_the_replacing_install_gives_back_the_same_apparatus`,
`test_a_user_working_an_obligation_keeps_it_across_a_replacing_document`
- `tests/browser/projection/test_revision_patches.py`:
`test_a_revision_replaces_the_widget_it_rewrote_and_keeps_the_one_it_did_not`
- `tests/journeys/test_render_application_boundary.py`:
`test_a_settled_delivery_activates_one_fresh_document_with_continuity`

</details>

Refs #4225 — automated triage
Refs #3985

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.

2 participants