test: remove interval and give more time to unsync#55006
test: remove interval and give more time to unsync#55006nodejs-github-bot merged 4 commits intonodejs:mainfrom
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.
Can/Should this be simplified with node:timers/promises?
There was a problem hiding this comment.
I didn't think about it, thanks for the suggestion, I'll take a look 😁
There was a problem hiding this comment.
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.
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.25% +0.20%
==========================================
Files 652 651 -1
Lines 183765 183877 +112
Branches 35863 35857 -6
==========================================
+ Hits 161789 162273 +484
+ Misses 15229 14898 -331
+ Partials 6747 6706 -41 |
140ae8d to
48930c6
Compare
| function wait(ms) { | ||
| return new Promise((resolve) => setTimeout(resolve, ms)); | ||
| } |
There was a problem hiding this comment.
You can use setTimeout() from node:timers/promises for this exact functionality.
This comment was marked as outdated.
This comment was marked as outdated.
|
I see this test fail a lot on windows platform, could we queue a stress test? |
|
Stress test CI: https://ci.nodejs.org/view/Stress/job/node-stress-single-test/538/ 🟢 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
mcollina
left a comment
There was a problem hiding this comment.
You might want to use the flush option of writeFile to cause an fsync: https://nodejs.org/docs/latest/api/fs.html#fspromiseswritefilefile-data-options.
|
Landed in 02e8972 |
PR-URL: #55006 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: nodejs#55006 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: nodejs#55006 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Refs: #55006 Refs: #54807 (comment) PR-URL: #56470 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Refs: nodejs#55006 Refs: nodejs#54807 (comment) PR-URL: nodejs#56470 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This PR should address #54807.
I'm leaving this in Draft while testing more extensively 🚀