Repository navigation
Settle comparison before disconnecting its watcher in the browser test - #2581
Merged
Merged
Conversation
The browser test detached its changed subtree before the asynchronous comparison had read it. Under suite load the comparison could then report no changed passage, so the watcher had no mark to paint. Settle and verify the first comparison before detaching, then change the comparison while the watcher is away and verify a failed return still permits its next mark.
max-sixty
added a commit
that referenced
this pull request
Oct 12, 2026
…parison paint to one report (#2588) `main`'s push `ci` has not completed green since #2568. The last two completed runs ([38235572771](https://github.com/max-sixty/leaf/actions/runs/38235572771) on 1ace63b, [38244446941](https://github.com/max-sixty/leaf/actions/runs/38244446941) on e5aca3e) failed three `main`-tier tests. Two are already fixed on `main`; this PR fixes the third and tightens one of the fixed ones. ## Behaviour that changed - **`test_an_export_keeps_its_quiet_words_off_screen` runs again.** #2555 removed the `x-paints` key and the `state` property from `declared_reading_package`, but this test still wrote `<lf-reading state="done">`, so `page check` refused the page before the export ran (`Additional properties are not allowed ('state' was unexpected)`). The test is `main`-tier and lives in a file #2555 did not edit, so `--changed-since` never selected it. It now takes its quiet word from a highlighted `lf-code` line, which the default package draws, and drops the fixture. With `.lf-quiet`'s clip removed from the theme, the test fails, as it did before. - **A failed comparison paint must be reported exactly once.** `test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparison` counted only `leaf:` reports, and its comment expected a second, uncaught record of the throw. Since #2575, `readingPaint` reports the failure once and nothing escapes. On current `main` the page records one error, `leaf: paint failed for lf-tabs#views: …`. The test now requires exactly that error. A paint that also rethrows from a microtask fails it. The other two failures need nothing more. `test_a_reaction_on_a_visual_part_names_that_part` was fixed by #2582, and the comparison test's arrangement by #2581. ## Evidence - On `main` 4f81e81, the export test fails with the refusal above. With this change it passes. - `leaf-dev flake` (18 copies, six at a time) passed 18/18 for the export test, the comparison test and the reaction test. A flake run of `tests/test_render_words_watch.py` also passed 18/18 for every test. That file's `TypeError: Cannot read properties of null (reading 'present')` did not reproduce on `main` and is not in either failed run's log. - The other two `declared_reading_package` tests still pass (`test_the_render_gate_catches_a_declared_word_that_never_reached_the_page`, `test_a_word_the_revision_adds_to_a_surviving_element_is_said`). Hand-written source delta: 0 lines. Test delta: +10 −12 (`tests/test_render_export.py` +8 −10, `tests/test_render_options_settled.py` +2 −2). > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main CI run failed the new comparison-watcher test because its arrangement detached the changed subtree before the asynchronous comparison had finished reading it. Under suite load, the comparison could settle with no changed passage, leaving no Δ mark for either watcher. This PR settles and verifies the first comparison before detaching the tabs, then changes the comparison while they are away. The return still throws once, and the next change must repaint the decision tab's mark.
The test failed in the linked run before this change and passes with the corrected arrangement on current
main. The focused comparison and reaction tests passed together (uv run pytest -q -n0with their two node IDs).