Skip to content

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Sep 28, 2025

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

Fixes: #60051
Refs: #52601

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

Fixes: nodejs#60051
Refs: nodejs#52601
@nodejs-github-bot nodejs-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 (const fileName of [...this.files]) {
await writeFile(this.filePath(fileName), Date.now() + fileName.repeat(1e4));
}
await setTimeout(common.platformTimeout(100));
Copy link
Member Author

@lpinca lpinca Sep 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.
await setTimeout(common.platformTimeout(100));
Copy link
Member Author

@lpinca lpinca Sep 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

@gurgunday gurgunday 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

Copy link

codecov bot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.45%. Comparing base (c6316f9) to head (d3b5d31).
⚠️ Report is 17 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      207546   207546              
  Branches    40011    39997      -14     
==========================================
- Hits       183591   183575      -16     
- Misses      15949    15955       +6     
- Partials     8006     8016      +10     

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

@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@nodejs-github-bot
Copy link
Collaborator

@gurgunday gurgunday added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 1, 2025
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. needs-ci PRs that need a full CI run. test Issues 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
4 participants