Skip to content

fix(apidocs): pin where the navigation leak test finds a growth - #29

Merged
Sam Gammon (sgammon) merged 3 commits into
mainfrom
fix/apidocs-astro-nav-growth
Nov 22, 2026
Merged

Sam Gammon (sgammon) merged 3 commits into
mainfrom
fix/apidocs-astro-nav-growth

Conversation

@sgammon

@sgammon Sam Gammon (sgammon) commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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.

…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>
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 7cc51f3.

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

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>
@datadog-official

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>
@sgammon Sam Gammon (sgammon) changed the title fix(apidocs): find the node growth across navigations on CI fix(apidocs): pin where the navigation leak test finds a growth Nov 22, 2026
@sgammon
Sam Gammon (sgammon) marked this pull request as ready for review November 22, 2026 03:04

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@sgammon
Sam Gammon (sgammon) merged commit 4588d7d into main Nov 22, 2026
10 of 11 checks passed
@sgammon
Sam Gammon (sgammon) deleted the fix/apidocs-astro-nav-growth branch November 22, 2026 03:10
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.

1 participant