Visitar URL original
test: prevent unwanted dependencyOwners removal by Ceres6 · Pull Request #55565 · nodejs/node · GitHub
The Wayback Machine - https://web.archive.org/web/20241202214654/https://github.com/nodejs/node/pull/55565
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: prevent unwanted dependencyOwners removal #55565

Merged
merged 5 commits into from
Nov 17, 2024

Conversation

Ceres6
Copy link
Contributor

@Ceres6 Ceres6 commented Oct 27, 2024

remove file from watcher dependencyOwners on file change only if it has no other owners.

Closes #55095

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 27, 2024
@RedYetiDev RedYetiDev added test_runner Issues and PRs related to the test runner subsystem. fs Issues and PRs related to the fs subsystem / file system. watch-mode Issues and PRs related to watch mode labels Oct 27, 2024
@RedYetiDev
Copy link
Member

The subsystem should be fs (unless we have a more specific one for watch-mode?).

@pmarchini
Copy link
Member

The subsystem should be fs (unless we have a more specific one for watch-mode?).

Hey @RedYetiDev, yes it makes sense 😁

cc @nodejs/fs WDYT about this? 😁

Copy link

codecov bot commented Oct 27, 2024 •

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.44%. Comparing base (8807549) to head (44f0da0).
Report is 124 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/watch_mode/files_watcher.js 25.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #55565   +/-   ##
=======================================
  Coverage   88.43%   88.44%           
=======================================
  Files         654      654           
  Lines      187698   187701    +3     
  Branches    36123    36133   +10     
=======================================
+ Hits       165998   166011   +13     
+ Misses      14945    14936    -9     
+ Partials     6755     6754    -1     
Files with missing lines Coverage Δ
lib/internal/watch_mode/files_watcher.js 89.26% <25.00%> (+6.09%) ⬆️

... and 33 files with indirect coverage changes

@cjihrig
Copy link
Contributor

cjihrig commented Oct 28, 2024

Since the code change here is not directly related to the test runner, is it possible to create a test case that does not rely on the test runner?

IMO this test can be added to test-runner-watch-mode-complex

Sometimes it's better to have things in separate test files. Even though the test runner can handle it, it can lead to other issues. For example, when a test is marked flaky, the entire test file is marked flaky (watch mode tests are almost always flaky). Additionally, the Python runner imposes a timeout per file, not per test. Bigger tests can lead to timeouts on some of the slower CI machines.

Ceres6 and others added 3 commits October 30, 2024 18:32
remove file from watcher dependencyOwners on file change only if it has
no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
@Ceres6 Ceres6 force-pushed the test/test-runner-complex-dependencies branch from 9f0b735 to bd9a3ed Compare October 30, 2024 17:32
@Ceres6 Ceres6 requested a review from pmarchini October 30, 2024 17:33
Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
Copy link
Member

@pmarchini pmarchini left a comment

Choose a reason for hiding this comment

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

LGTM

if (common.isAIX)
common.skip('folder watch capability is limited in AIX.');

tmpdir.refresh();
Copy link
Member

Choose a reason for hiding this comment

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

As a new test, it would be helpful to include comments here describing what expected behaviors are being tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean like a general summary? Because each block of code below has a comment of the behaviour

Copy link
Member

Choose a reason for hiding this comment

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

Hey @jasnell, is this comment a blocker for you?
If not, I suggest we go ahead and land it 😄

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Nov 6, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 6, 2024
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 17, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Nov 17, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/55565
✔  Done loading data for nodejs/node/pull/55565
----------------------------------- PR info ------------------------------------
Title      test: prevent unwanted dependencyOwners removal (#55565)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     Ceres6:test/test-runner-complex-dependencies -> nodejs:main
Labels     fs, author ready, needs-ci, test_runner, watch-mode
Commits    5
 - test: prevent unwanted dependencyOwners removal
 - fixup! fs: prevent unwanted dependencyOwners removal
 - fixup! fixup! fs: prevent unwanted dependencyOwners removal
 - fixup! fixup! fixup! fs: prevent unwanted dependencyOwners removal
 - Update test/parallel/test-watch-file-shared-dependency.mjs
Committers 2
 - Carlos Espa <carlos.espa@nearform.com>
 - GitHub <noreply@github.com>
PR-URL: https://github.com/nodejs/node/pull/55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 27 Oct 2024 19:08:05 GMT
   ✔  Approvals: 2
   ✔  - Pietro Marchini (@pmarchini): https://github.com/nodejs/node/pull/55565#pullrequestreview-2407418012
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/55565#pullrequestreview-2416994220
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-11-06T13:27:11Z: https://ci.nodejs.org/job/node-test-pull-request/63455/
- Querying data for job/node-test-pull-request/63455/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 55565
From https://github.com/nodejs/node
 * branch                  refs/pull/55565/merge -> FETCH_HEAD
✔  Fetched commits as b648d37ad760..44f0da079c64
--------------------------------------------------------------------------------
[main 6c99f996c3] test: prevent unwanted dependencyOwners removal
 Author: Carlos Espa <carlos.espa@nearform.com>
 Date: Sun Oct 27 20:00:31 2024 +0100
 2 files changed, 133 insertions(+), 1 deletion(-)
 create mode 100644 test/parallel/test-runner-complex-dependencies.mjs
[main 6cef4828a3] fixup! fs: prevent unwanted dependencyOwners removal
 Author: Carlos Espa <carlos.espa@nearform.com>
 Date: Wed Oct 30 12:24:13 2024 +0100
 1 file changed, 5 insertions(+), 8 deletions(-)
[main d056fb3b5a] fixup! fixup! fs: prevent unwanted dependencyOwners removal
 Author: Carlos Espa <carlos.espa@nearform.com>
 Date: Wed Oct 30 18:23:35 2024 +0100
 1 file changed, 53 insertions(+)
 create mode 100644 test/parallel/test-watch-file-shared-dependency.mjs
[main be9c31780f] fixup! fixup! fixup! fs: prevent unwanted dependencyOwners removal
 Author: Carlos Espa <carlos.espa@nearform.com>
 Date: Wed Oct 30 18:37:21 2024 +0100
 1 file changed, 1 insertion(+), 1 deletion(-)
[main 33fb04b773] Update test/parallel/test-watch-file-shared-dependency.mjs
 Author: Carlos Espa <43477095+Ceres6@users.noreply.github.com>
 Date: Thu Oct 31 09:25:46 2024 +0100
 1 file changed, 1 insertion(+)
   ✔  Patches applied
There are 5 commits in the PR. Attempting autorebase.
Rebasing (2/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: prevent unwanted dependencyOwners removal

remove file from watcher dependencyOwners on file change only if it has
no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD b976976723] test: prevent unwanted dependencyOwners removal
Author: Carlos Espa <carlos.espa@nearform.com>
Date: Sun Oct 27 20:00:31 2024 +0100
2 files changed, 133 insertions(+), 1 deletion(-)
create mode 100644 test/parallel/test-runner-complex-dependencies.mjs
Rebasing (3/10)
Rebasing (4/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fixup! fs: prevent unwanted dependencyOwners removal

PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD 25d50d7d5a] fixup! fs: prevent unwanted dependencyOwners removal
Author: Carlos Espa <carlos.espa@nearform.com>
Date: Wed Oct 30 12:24:13 2024 +0100
1 file changed, 5 insertions(+), 8 deletions(-)
Rebasing (5/10)
Rebasing (6/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fixup! fixup! fs: prevent unwanted dependencyOwners removal

PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD ba693148d0] fixup! fixup! fs: prevent unwanted dependencyOwners removal
Author: Carlos Espa <carlos.espa@nearform.com>
Date: Wed Oct 30 18:23:35 2024 +0100
1 file changed, 53 insertions(+)
create mode 100644 test/parallel/test-watch-file-shared-dependency.mjs
Rebasing (7/10)
Rebasing (8/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fixup! fixup! fixup! fs: prevent unwanted dependencyOwners removal

PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD c95376724f] fixup! fixup! fixup! fs: prevent unwanted dependencyOwners removal
Author: Carlos Espa <carlos.espa@nearform.com>
Date: Wed Oct 30 18:37:21 2024 +0100
1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (9/10)
Rebasing (10/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Update test/parallel/test-watch-file-shared-dependency.mjs

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD b8be1004ec] Update test/parallel/test-watch-file-shared-dependency.mjs
Author: Carlos Espa <43477095+Ceres6@users.noreply.github.com>
Date: Thu Oct 31 09:25:46 2024 +0100
1 file changed, 1 insertion(+)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/11878050213

@aduh95 aduh95 merged commit b0051de into nodejs:main Nov 17, 2024
67 checks passed
@aduh95
Copy link
Contributor

aduh95 commented Nov 17, 2024

Landed in b0051de

RafaelGSS pushed a commit that referenced this pull request Nov 18, 2024
Remove files from watcher `dependencyOwners` on file change only if it
has no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
Remove files from watcher `dependencyOwners` on file change only if it
has no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: nodejs#55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Ceres6 added a commit to Ceres6/node that referenced this pull request Nov 26, 2024
Remove files from watcher `dependencyOwners` on file change only if it
has no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: nodejs#55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
ruyadorno pushed a commit that referenced this pull request Nov 27, 2024
Remove files from watcher `dependencyOwners` on file change only if it
has no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
ruyadorno pushed a commit that referenced this pull request Nov 27, 2024
Remove files from watcher `dependencyOwners` on file change only if it
has no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
ruyadorno pushed a commit that referenced this pull request Nov 27, 2024
Remove files from watcher `dependencyOwners` on file change only if it
has no other owners.

Co-authored-by: Pietro Marchini <pietro.marchini94@gmail.com>
PR-URL: #55565
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. watch-mode Issues and PRs related to watch mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants