Repository navigation
Fix the ticker cadence test under Node 24, and run the suite on 24 in CI - #543
Merged
Merged
Conversation
…Node's lazy internals. Node 24.19 started allocating an EventTarget's listener maps only when the first listener arrives, so the old probe found no symbol-keyed collection on a fresh signal and its own vacuity guard failed, even though the ticker was releasing everything correctly. Plain listeners now come from the public getEventListeners, and only the AbortSignal.any dependant set is still read by name, treating an absent one as empty. A control composite proves that probe works on the running Node, and the fake snapshot listens on its signal the way fetch does, since newer Node only registers a composite on its sources once something listens to it -- without that, swapping the tick signal back to AbortSignal.any on the session signal would pass silently on 24. Test-only; no runtime behaviour changes.
engines.node allows 24 but the matrix only ran 22, which is how a Node-24-only test failure sat on main unnoticed. One ubuntu job, install plus typecheck plus the root tests and nothing else: packaging and the tarball smoke aren't where a runtime difference shows up, and the macOS and Windows legs on 24 would cost far more than they'd catch.
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.
engines.nodeallows anything from 22.19, but CI only runs 22, and on Node 24.21 the suite has one failure on a cleanmain:The ticker is fine; the test was reading Node internals that moved. It counted registrations on the session
AbortSignalby walking its own-symbol properties and summing anything with a.size, with a guard that at least one such thing existed so the test couldn't go vacuous. Node 24.19 started allocating anEventTarget's listener maps lazily (nodejs/node#63702), so on a fresh signal there is nothing with a.sizeand the guard itself fires before the ticker does anything. Bisected across 22.13, 22.14, 22.23, 24.16, 24.21 and 26.10: 24.16 behaves like 22, 24.21 and 26 don't, and the changelog puts the change in 24.19.0.Test-only change; no runtime behaviour moves. Plain listeners are now counted with the public
getEventListeners(signal, "abort"). The one thing with no public API -- whatAbortSignal.anyhangs on its sources -- is still read from the privatekDependantSignalsset, by exact name, with an absent set treated as empty. A control composite replaces the old guard: the test buildsAbortSignal.any([control.signal]), attaches a listener, and asserts the probe sees it, so if Node renames the internal the test fails loudly instead of quietly measuring nothing.While checking the new test couldn't pass vacuously, a second Node 24 difference turned up: since at least 24.16,
AbortSignal.any([src])only registers the composite onsrconce the composite gets a listener (22 registers immediately). The old test's fake snapshot never listened on the signal it was handed, so if someone swappedtickSignal()back toAbortSignal.any([this.abort.signal, ...])-- the exact leak this test exists to catch -- it would fail on 22 and pass silently on 24. The fake now listens, the wayfetchdoes. In production that leak is still real on 24 (five listened-to composites retain five entries, and GC doesn't release them).Checked by mutation on both Nodes: a no-op
done()fails with 50 vs 0, and theAbortSignal.anyswap fails with 50 vs 0; the swap with a non-listening fake passes silently on 24, which is why the listening fake is in the commit.Verification
Full suite under 24.21.0 and 22.23.2 with an install built for each: identical, 3851 passed, 1 skipped. The earlier reports of
session-indexfailures under 24 are abetter-sqlite3ABI mismatch from running a 22-built install under 24 (NODE_MODULE_VERSION 127vs137); afternpm rebuild better-sqlite3it's 33/33. macOS arm64 only; nothing was run on Linux or Windows under 24.Second commit: CI gets an ubuntu-only
test-node24job (install, typecheck, root tests; no packaging or smoke-pack), which is how this would have been caught. About 1.5 runner-minutes per run, no wall-clock cost since it runs beside the existing legs. The macOS and Windows legs stay on 22: what broke here isn't platform-specific, and Windows smoke-pack alone is 6.5 minutes.Not in this PR:
resolveHistoryIdhas its ownAbortSignal.anycall with no test covering the leak shape; a follow-up.