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 — watch: track all dependencies of an owner by christianaurichzm · Pull Request #66139 · nodejs/node

Conversation

@christianaurichzm

@christianaurichzm christianaurichzm commented Sep 19, 2026

Copy link
Copy Markdown
Member

FilesWatcher#filterFile() reads #ownerDependencies with the dependency path, but writes the set back keyed by the owner. As a result, each call starts a fresh set and overwrites the previous one, so an owner keeps only the last dependency registered for it.

Each test child reports the modules it loads through watch:require/watch:import, with one filterFile() call per module. A test file with N dependencies therefore keeps 1 and loses N-1.

unfilterFilesOwnedBy() walks that set to release an owner's dependencies, so the lost dependencies remain in #filteredFiles and #dependencyOwners. A restart re-reports the modules the test still loads, which hides the stale state for those modules, but a dependency it stopped requiring is never reported again and therefore never removed:

# a.test.js requires dep1.js and dep2.js
node --test --watch a.test.js

# drop require('./dep1.js') from a.test.js   -> restarts, as expected
# touch dep1.js                              -> restarts again

The second restart should not happen: dep1.js is no longer a dependency of any test. Its stale entries otherwise remain for the lifetime of the process.

The bug was introduced with #45214 (97355c74e819), first released in v19.2.0 and later backported to v18.13.0. test-watch-file-shared-dependency does not catch it because it registers one dependency per owner, while this bug requires an owner with multiple dependencies.

The diff also stores the #dependencyOwners lookup in a local while removing an owner's dependencies, avoiding repeated map lookups for each dependency.

Refs: #45214

Sorry, something went wrong.

Uh oh!

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

All reactions
@christianaurichzm
watch: track all dependencies of an owner
c3cc140
filterFile() reads #ownerDependencies with the dependency path, but
writes the set back keyed by the owner, so each call starts a fresh set
and overwrites the previous one. An owner keeps only the last
dependency registered for it.

unfilterFilesOwnedBy() walks that set to release an owner's
dependencies, so every other one stays in #filteredFiles and
#dependencyOwners. Under `node --test --watch` a restart re-reports the
modules the test still loads, which hides it for those, but a
dependency it stopped requiring is never reported again and keeps
re-running the test.

Read #ownerDependencies with the key it is written with, and collapse
the repeated #dependencyOwners lookup in the loop, which now runs once
per dependency rather than once per owner.

Signed-off-by: Christian Aurich Zanettini Martins <[email protected]>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 19, 2026
@codecov

codecov Bot commented Sep 19, 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.28%. Comparing base (bca9bbe) to head (c3cc140).
⚠️ Report is 841 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66139   +/-   ##
=======================================
  Coverage   90.28%   90.28%           
=======================================
  Files         790      790           
  Lines      271982   271985    +3     
  Branches    51915    51921    +6     
=======================================
+ Hits       245546   245571   +25     
+ Misses      16947    16901   -46     
- Partials     9489     9513   +24     
Files with missing lines Coverage Δ
lib/internal/watch_mode/files_watcher.js 91.55% <100.00%> (+0.11%) ⬆️

... and 32 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.

@christianaurichzm

christianaurichzm commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@MoLow since this is in the FilesWatcher dependency tracking from #45214, could you take a look when you get a chance? cc @ShogunPanda. If it looks good, could you also add request-ci? Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

MoLow
MoLow approved these changes Oct 7, 2026
View reviewed changes
@panva panva added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 10, 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 10, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@christianaurichzm

christianaurichzm commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@panva Could you resume the CI when you get a chance? Thanks!

All reactions

Sorry, something went wrong.

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

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@inoway46 inoway46 added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 1, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 1, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

inoway46
inoway46 approved these changes Nov 6, 2026
View reviewed changes
@inoway46 inoway46 added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 6, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 280798a into nodejs:main Nov 6, 2026
83 checks passed

Uh oh!

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

@nodejs-github-bot

nodejs-github-bot commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Landed in 280798a

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 Nov 6, 2026
aduh95 pushed a commit that referenced this pull request Nov 11, 2026
@christianaurichzm @aduh95
watch: track all dependencies of an owner
819d9fd
filterFile() reads #ownerDependencies with the dependency path, but
writes the set back keyed by the owner, so each call starts a fresh set
and overwrites the previous one. An owner keeps only the last
dependency registered for it.

unfilterFilesOwnedBy() walks that set to release an owner's
dependencies, so every other one stays in #filteredFiles and
#dependencyOwners. Under `node --test --watch` a restart re-reports the
modules the test still loads, which hides it for those, but a
dependency it stopped requiring is never reported again and keeps
re-running the test.

Read #ownerDependencies with the key it is written with, and collapse
the repeated #dependencyOwners lookup in the loop, which now runs once
per dependency rather than once per owner.

Signed-off-by: Christian Aurich Zanettini Martins <[email protected]>
PR-URL: #66139
Refs: #45214
Reviewed-By: Moshe Atlow <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
2026-11-12, Version 27.0.0-alpha.0.1.0 (Alpha) #67415
Merged
aduh95 pushed a commit that referenced this pull request Nov 12, 2026
@christianaurichzm @aduh95
watch: track all dependencies of an owner
60c717f
filterFile() reads #ownerDependencies with the dependency path, but
writes the set back keyed by the owner, so each call starts a fresh set
and overwrites the previous one. An owner keeps only the last
dependency registered for it.

unfilterFilesOwnedBy() walks that set to release an owner's
dependencies, so every other one stays in #filteredFiles and
#dependencyOwners. Under `node --test --watch` a restart re-reports the
modules the test still loads, which hides it for those, but a
dependency it stopped requiring is never reported again and keeps
re-running the test.

Read #ownerDependencies with the key it is written with, and collapse
the repeated #dependencyOwners lookup in the loop, which now runs once
per dependency rather than once per owner.

Signed-off-by: Christian Aurich Zanettini Martins <[email protected]>
PR-URL: #66139
Refs: #45214
Reviewed-By: Moshe Atlow <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 12, 2026
@christianaurichzm @aduh95
watch: track all dependencies of an owner
54626ad
filterFile() reads #ownerDependencies with the dependency path, but
writes the set back keyed by the owner, so each call starts a fresh set
and overwrites the previous one. An owner keeps only the last
dependency registered for it.

unfilterFilesOwnedBy() walks that set to release an owner's
dependencies, so every other one stays in #filteredFiles and
#dependencyOwners. Under `node --test --watch` a restart re-reports the
modules the test still loads, which hides it for those, but a
dependency it stopped requiring is never reported again and keeps
re-running the test.

Read #ownerDependencies with the key it is written with, and collapse
the repeated #dependencyOwners lookup in the loop, which now runs once
per dependency rather than once per owner.

Signed-off-by: Christian Aurich Zanettini Martins <[email protected]>
PR-URL: #66139
Refs: #45214
Reviewed-By: Moshe Atlow <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
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
@christianaurichzm @gabylb
watch: track all dependencies of an owner
4947f1f
filterFile() reads #ownerDependencies with the dependency path, but
writes the set back keyed by the owner, so each call starts a fresh set
and overwrites the previous one. An owner keeps only the last
dependency registered for it.

unfilterFilesOwnedBy() walks that set to release an owner's
dependencies, so every other one stays in #filteredFiles and
#dependencyOwners. Under `node --test --watch` a restart re-reports the
modules the test still loads, which hides it for those, but a
dependency it stopped requiring is never reported again and keeps
re-running the test.

Read #ownerDependencies with the key it is written with, and collapse
the repeated #dependencyOwners lookup in the loop, which now runs once
per dependency rather than once per owner.

Signed-off-by: Christian Aurich Zanettini Martins <[email protected]>
PR-URL: nodejs#66139
Refs: nodejs#45214
Reviewed-By: Moshe Atlow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@MoLow MoLow MoLow approved these changes
+1 more reviewer
@inoway46 inoway46 inoway46 approved these changes
Reviewers whose approvals may not affect merge requirements

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. needs-ci PRs that need a full CI run.

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

@christianaurichzm @nodejs-github-bot @MoLow @inoway46 @panva
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.