-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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: remove interval and give more time to unsync #55006
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
e6e0999
to
9daffe6
Compare
await new Promise((resolve) => setTimeout(() => { | ||
unlinkSync(fileToDeletePathLocal); | ||
resolve(); | ||
}, common.platformTimeout(1000))); |
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.
Can/Should this be simplified with node:timers/promises
?
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.
I didn't think about it, thanks for the suggestion, I'll take a look 😁
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.
Would using node:fs/promises
be enough here? It seems weird to have to put a sync operation in an async one
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.
Hey @aduh95, yes, no problem at all.
The only important logic is the "sleep" after the delete to ensure that the watcher has received the event and completed the test run before proceeding.
Thanks for your feedback, I'll fixit ASAP 😁
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55006 +/- ##
==========================================
- Coverage 88.04% 88.03% -0.01%
==========================================
Files 652 652
Lines 183765 183761 -4
Branches 35863 35857 -6
==========================================
- Hits 161789 161769 -20
- Misses 15229 15233 +4
- Partials 6747 6759 +12 |
This PR should address #54807.
I'm leaving this in Draft while testing more extensively 🚀