GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: keep objects alive in finalization fixtures by mcollina · Pull Request #66869 · nodejs/node

Conversation

@mcollina

@mcollina mcollina commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

test-process-finalization flakes on Windows CI in the unregister-function.mjs case:

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

'' !== 'b:exit'

process.finalization holds registered objects only through weak references, and skips the callback at exit if the object is gone. In the fixture, a and b are top-level bindings that no closure captures, so a GC before exit can collect b. Its exit callback then never runs. The same could hide a broken unregister of a.

finalization-cleanup.mjs has the same problem: first and third are only held by keptAlive, which nothing captures. Forcing a GC in beforeExit (--require a preload doing process.once('beforeExit', () => gc())) makes it fail deterministically with actual: []; with this change it passes.

Both fixtures now reference the objects from their exit listener so they stay reachable until the assertions run. The other fixtures already keep their objects alive this way, or expect them to be collected.

🤖 Generated with Claude Code

https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.50%. Comparing base (2052d0d) to head (3aa30fc).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66869      +/-   ##
==========================================
- Coverage   90.50%   90.50%   -0.01%     
==========================================
  Files         797      797              
  Lines      278195   278221      +26     
  Branches    53453    53461       +8     
==========================================
+ Hits       251777   251800      +23     
- Misses      16795    16802       +7     
+ Partials     9623     9619       -4     

see 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina @claude
test: keep objects alive in finalization fixtures
3aa30fc
process.finalization only holds weak references to registered objects.
In unregister-function.mjs and finalization-cleanup.mjs the registered
objects were not captured by any closure, so a GC before exit could
collect them, skipping their exit callbacks and failing the assertions.
Reference them from the exit listeners so they stay reachable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U
Signed-off-by: Matteo Collina <[email protected]>
@mcollina mcollina changed the title test: keep objects alive in finalization fixture test: keep objects alive in finalization fixtures Oct 20, 2026
@mcollina
mcollina force-pushed the fix-flaky-unregister-function branch from 0c42211 to 3aa30fc Compare October 20, 2026 11:47
gurgunday
gurgunday approved these changes Oct 20, 2026
View reviewed changes

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gurgunday gurgunday added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Oct 20, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 20, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78529/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lpinca
lpinca approved these changes Oct 20, 2026
View reviewed changes
@panva panva added flaky-test Issues and PRs involving tests that fail intermittently in CI. commit-queue PRs queued for automated landing through the Commit Queue. labels Oct 21, 2026
@nodejs-github-bot
nodejs-github-bot merged commit fd20448 into nodejs:main Oct 22, 2026
74 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Landed in fd20448

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 22, 2026
@panva

panva commented Oct 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

FWIW when the flake was added resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. did refuse to resume on the account of a failure in the very test it touched. Following that the same code was force-pushed and request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. then ran to completion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 mentioned this pull request Oct 27, 2026
2026-10-28, Version 27.0.0-alpha.0.0.0 (Alpha) #67062
Merged
aduh95 pushed a commit that referenced this pull request Nov 12, 2026
@mcollina @claude @aduh95
test: keep objects alive in finalization fixtures
674fc34
process.finalization only holds weak references to registered objects.
In unregister-function.mjs and finalization-cleanup.mjs the registered
objects were not captured by any closure, so a GC before exit could
collect them, skipping their exit callbacks and failing the assertions.
Reference them from the exit listeners so they stay reachable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U
Signed-off-by: Matteo Collina <[email protected]>
PR-URL: #66869
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 13, 2026
@mcollina @claude @aduh95
test: keep objects alive in finalization fixtures
743ac94
process.finalization only holds weak references to registered objects.
In unregister-function.mjs and finalization-cleanup.mjs the registered
objects were not captured by any closure, so a GC before exit could
collect them, skipping their exit callbacks and failing the assertions.
Reference them from the exit listeners so they stay reachable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U
Signed-off-by: Matteo Collina <[email protected]>
PR-URL: #66869
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
This was referenced Nov 20, 2026
2026-11-30, Version 24.23.0 'Krypton' (LTS) #67663
Open
2026-11-30, Version 26.14.0 'Lithium' (LTS) #67664
Open
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@mcollina @claude @gabylb
test: keep objects alive in finalization fixtures
02c5a91
process.finalization only holds weak references to registered objects.
In unregister-function.mjs and finalization-cleanup.mjs the registered
objects were not captured by any closure, so a GC before exit could
collect them, skipping their exit callbacks and failing the assertions.
Reference them from the exit listeners so they stay reachable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U
Signed-off-by: Matteo Collina <[email protected]>
PR-URL: nodejs#66869
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lpinca lpinca lpinca approved these changes
@gurgunday gurgunday gurgunday approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. flaky-test Issues and PRs involving tests that fail intermittently in CI. needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@mcollina @nodejs-github-bot @panva @lpinca @gurgunday
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.