Skip to content

Conversation

@lpinca
Copy link
Member

Add a delay before writing the files to ensure that the watcher receives the notifications.

Fixes: #60051
Refs: #52601

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Sep 28, 2025
for(constfileNameof[...this.files]){
awaitwriteFile(this.filePath(fileName),Date.now()+fileName.repeat(1e4));
}
awaitsetTimeout(common.platformTimeout(100));
Copy link
MemberAuthor

@lpincalpincaSep 28, 2025

Choose a reason for hiding this comment

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

If there was a reason for this I will add it back, but I don't see it.

Comment on lines +37 to +38
// Do the write with a delay to ensure that the OS is ready to notify us.
awaitsetTimeout(common.platformTimeout(100));
Copy link
MemberAuthor

@lpincalpincaSep 28, 2025

Choose a reason for hiding this comment

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

The same is done in other fs.watch() tests, for example:

// Do the write with a delay to ensure that the OS is ready to notify us.
setTimeout(()=>{
fs.writeFileSync(testFile,'world');
},common.platformTimeout(200));

Copy link
Member

Choose a reason for hiding this comment

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

I think this deserves a TODO to investigate why this is occuring and whether or not this is a bug.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There already an open issue (#52601) linked in the commit message.

Copy link
Member

@gurgundaygurgunday left a comment

Choose a reason for hiding this comment

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

Thank you!

lgtm

@codecov
Copy link

codecovbot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.45%. Comparing base (6f941fc) to head (dfdbb39).
⚠️ Report is 59 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #60060 +/- ## ========================================== - Coverage 88.45% 88.45% -0.01%  ========================================== Files 703 703 Lines 207826 207826 Branches 40030 40038 +8 ========================================== - Hits 183842 183826 -16 + Misses 15973 15972 -1 - Partials 8011 8028 +17 

see 27 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.

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@nodejs-github-bot

This comment was marked as outdated.

@gurgundaygurgunday added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 1, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

Add a delay before writing the files to ensure that the watcher receives the notifications. Fixes: nodejs#60051 Refs: nodejs#52601
@lpincalpincaforce-pushed the deflake/test-fs-promises-watch-iterator branch from d3b5d31 to dfdbb39CompareOctober 4, 2025 10:13
@lpinca
Copy link
MemberAuthor

Rebased, this needs new approvals.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@lpincalpinca added the review wanted PRs that need reviews. label Oct 8, 2025
@lpincalpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 9, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 9, 2025
@nodejs-github-botnodejs-github-bot merged commit f8a43f6 into nodejs:mainOct 9, 2025
60 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in f8a43f6

@lpincalpinca deleted the deflake/test-fs-promises-watch-iterator branch October 9, 2025 05:38
@RafaelGSSRafaelGSS mentioned this pull request Oct 13, 2025
9 tasks
aduh95 pushed a commit that referenced this pull request Oct 31, 2025
Add a delay before writing the files to ensure that the watcher receives the notifications. Fixes: #60051 Refs: #52601 PR-URL: #60060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 7, 2025
Add a delay before writing the files to ensure that the watcher receives the notifications. Fixes: #60051 Refs: #52601 PR-URL: #60060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-ciPRs that need a full CI run.review wantedPRs that need reviews.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parallel/test-fs-promises-watch-iterator is flaky

6 participants

@lpinca@nodejs-github-bot@addaleax@anonrig@joyeecheung@gurgunday