Repository navigation
Keep the quota fixture's placement render idempotent - #695
Merged
Merged
Conversation
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 nightly
cirun on main was cancelled at the job's 135-minute timeout, not byanyone:
tests/test_render_controls.py::test_a_stale_package_widget_uses_recursive_parent_eligibilitywedged its browser at 22:59, held its xdist worker for the remaining 114 minutes, and
the run ended with no summary and no
nightly.xmlartifact. This makes that testfinish in seconds again.
The fixture's
lf-quota.renderStatemoved its owner on every render:insertBeforeon an element the platform already has in place still removes andre-inserts it, which fires
disconnectedCallbackandconnectedCallback. The moduledrops its subscription in the first and renews it in the second, and the renewed
subscription renders — which moves the element again. Each turn is a fresh microtask, so
the page never yields: the renderer sits at ~110% CPU, and Playwright cannot get a reply
even to report its own 30-second timeout. That is why the suite hung rather than failing.
The guard belongs in the fixture because the contract is already stated against it.
skills/leaf/references/packages.mdasks a module for "a total, idempotentrenderState(state)" and names "arenderStatethat changes the page when handed thesame state again" as a render-gate fault. Every shipped widget that rewrites the
document keeps to it —
lf-boardreturns early when the columns already hold theordered cards,
lf-taskwhen the status attribute already reads the value — and thesibling placement fixture in
tests/test_render_projection.pyguards the same move withif (parent.children[index] !== this). This fixture was the one that did not, so it nowchecks its position before moving. The move it exercises, and every assertion about
where
#quotaends up, is unchanged.Bisected to 859c6cc (#666, "Make Leaf pages complete reactive applications"): the test
passed in 1.5s in the 2026-09-13 10:50 nightly on e2ebdcb, and hangs on every commit
from 859c6cc onward, including current main.
One thing that change leaves open, which this PR does not decide: before #666 a
non-idempotent
renderStatewas wasteful, and now it locks up the reader's tab. Therender gate is documented to catch exactly this fault and did not catch this widget.
Whether the runtime should bound a render that keeps re-entering itself is a question for
the reactive runtime rather than for a test fixture.
Reproduction and verification
Before, on main at 7acc84b — no output, killed by the outer timeout:
After:
1 passed in 5.26s.The loop, captured by counting
presentRendercalls per widget id and breaking after400, then reading the stacks off the page:
uv run pytest -q --run-nightly tests/test_render_controls.py— 90 passed, 4 failed in5:00. The four are on main already, all named in the cancelled run's own log
(
test_the_composed_corpus_declares_every_control_row_archetype,test_a_runtime_cannot_adopt_a_new_registry_while_it_is_loading,test_an_open_tab_reloads_before_posting_through_a_revendored_layer,test_a_covering_auxiliary_surface_keeps_a_replacement_document_inert). That runreported 22 failures and 4 errors before it hung; this PR addresses the hang only.
The everyday gate does not reach this file —
tests/test_render_controls.pyispytest.mark.nightlythroughout — so the proof for this change is the local run aboveand the next nightly.
Failed run: https://github.com/max-sixty/leaf/actions/runs/34787351258