Repository navigation
Stop a persistent test server through its command - #3327
Merged
Merged
Conversation
leaf-agent
added a commit
that referenced
this pull request
Oct 20, 2026
The [main CI run](https://github.com/max-sixty/leaf/actions/runs/39411015460) failed the aimed-press journey on a tab even though the press did not switch tabs: positioning a comment copied the tab panel's stylesheet `anchor-name` into its inline style, and the markup reading counted that presentation detail as a page change. The reading now excludes anchor names, as it already excluded generated margin-anchor names. It still compares the tab's selected state, content, and other markup after the press. The focused tab case failed on main before this change and passes afterward. This PR's CI passed that case but timed out while retiring a persistent test server; [PR #3327](#3327) addresses that separate test teardown failure. Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
… a rendering turn ending before observer deliveries (#3346) Two load-only flakes, each traced to its cause and fixed there. **A persistent server stopped by a signal could hang at exit.** This is the 120 s teardown timeout that #3327 worked around in `test_server_run_persistent_declines_the_claim_a_harness_session_offers` by stopping the server with `server stop`. The page subscription's `weakref.finalize` (`_PageChanges.connect`, `file_changes.py`) ran at interpreter exit by default. It closed the subscription while the row publisher and the lifetime check, both daemon threads, still waited on it. Each woke, found the subscription closed, and subscribed again, which registered a new finalizer that `weakref`'s exit handler then ran in turn. The loop ends only when the daemon threads fall behind `weakref`'s exit handler; in CI it outlasted the fixture's 120 s wait. A user who stops a foreground `leaf server run` with Ctrl-C hits the same path; `server stop` never did, because `exit_serving` calls `os._exit`. The finalizer now skips exit, since exit releases the native watches anyway. `FileChanges.matches` no longer checks the stop flag. `close` empties the roots `matches` compares, and with exit skipping the finalizer, nothing closes a subscription its owner still hands out, so the flag added nothing. The test now stops its server with Ctrl-C, as its user would, so it exercises the path that hung. On macOS, a persistent server sent SIGTERM after printing its URL hung past 10 s in 11 of 30 trials, and sent Ctrl-C in 7 of 27. With the change, none of 84 did (30 and 27 SIGTERMs, 27 Ctrl-Cs, at delays from 0 to 1.5 s). The CI hang was on Linux; the mechanism is in Python's exit sequence rather than the platform watcher, so I expect the same fix there but did not run it on Linux. **A rendering turn ended before its IntersectionObserver deliveries.** review-queue's and rust-sort's render-gate resize journeys failed now and then under load with a 32×32 keyboard stop present on one pass and missing on the other. The stop is the Copy control of a code block far down the page, which leaves layout when the runtime's near-window IntersectionObserver (`anchorView`, `css-anchors.js`) says its block is more than a screen away. The driver's `requestFrame` marked a turn presented from a task queued in its animation-frame callback, and Chrome and Firefox deliver that update's IntersectionObserver callbacks in a later task. So `one_frame`, and `rendered` after it, could return before the callback that takes the control out of layout. `requestFrame` now starts an IntersectionObserver in the animation frame and marks the turn from a task its first notice queues, after every observer delivery of that update. `one_frame`'s docstring already promised this ("its observer deliveries included"). It applies to `page check --render` as well as the suite. The new test checks the order directly: it failed 5 of 5 runs before the change and passed 5 of 5 after. review-queue's journey at 4× CPU throttling failed 3 of 14 runs before and passed 20 of 20 after; rust-sort's passed 10 of 10 after, though it had also passed 6 of 6 before at that throttle. > _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.
PR #3322's CI run passed
test_server_run_persistent_declines_the_claim_a_harness_session_offers, then timed out for 120 seconds while itsspawnfixture tried to retire the persistent server at teardown. The test starts a server whose stated lifetime requires an explicit stop, but it left that stop to the fixture's process-group signal. It now callshosting.cmd_stopand waits for the server to exit, as the neighboring persistent-server tests do. The fixture still guards early failures.The focused test passes after the change. The CI timeout was intermittent, so that local pass alone does not establish the cause; the change makes the test exercise the server's explicit-stop contract before teardown.