Repository navigation
fix(apidocs): pin where the navigation leak test finds a growth - #29
Merged
Merged
Conversation
…the navigation leak test Diagnostic only, to read the growth that fails on CI (nodes 1058 to 1448 with the listener count flat) by container and by detached element. Signed-off-by: Sam Gammon <sam@elide.dev>
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…stic) Signed-off-by: Sam Gammon <sam@elide.dev>
This comment has been minimized.
This comment has been minimized.
…count the page's elements The Vitest job on main failed "twenty navigations leave listener and node counts flat" once (nodes 1058 to 1448, listeners and documents flat). I could not reproduce it: not locally with the production build under wrangler dev, with CPU throttled up to 20x, with every request delayed up to 800 ms, with animations slowed 20x, with navigations fired 0 to 150 ms apart (interrupting the previous page), with two cores shared with busy loops, nor in eight runs of the job on GitHub with a census in the test (live elements 644 and no detached elements reachable from script, at 8, 12, 16, 20 and 24 navigations, every time). The client code in src/astro/client.ts replaces the navigator's rows and owns every listener with one AbortController per page, so I found nothing to fix there. The cause of the one failure is not known: the Chromium "Nodes" metric also counts nodes awaiting collection, which the test cannot tell from a leak. So the test now reads the growth itself. It counts the page's live elements and the detached elements still reachable from script (Runtime.queryObjects), and requires the live count and the per-container counts to stay equal and no detached element to remain. These assertions pass on the page as it is. The existing assertions are unchanged. When any fails, the test prints the census before and after, by top-level container, so a growth is located at once. Checked by mutation: with the navigator's old rows no longer removed, the test fails and the census shows div.layout going from 1027 to 3417 elements (listeners 375 to 1175). Also seen once, and not changed: "layout stability > a navigation shifts nothing" read a shift of 4e-7 on a GitHub runner. Signed-off-by: Sam Gammon <sam@elide.dev>
Sam Gammon (sgammon)
marked this pull request as ready for review
November 22, 2026 03:04
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
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.
Test-only. Makes the navigation leak test count live and detached elements by container, and print the census when a count grows. Could not reproduce the one CI failure on main (nodes 1058 to 1448); no client code changed. Details in the commit message.