Uh oh!
There was an error while loading. Please reload this page.
test: remove interval and give more time to unsync - #55006
Conversation
nodejs-github-bot
commented
Sep 19, 2024
Review requested:
|
| 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 |
nodejs-github-bot
commented
Sep 21, 2024
| 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
jakecastelli
commented
Sep 23, 2024
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.
nodejs-github-bot
commented
Sep 24, 2024
nodejs-github-bot
commented
Sep 24, 2024
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>
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>
This PR should address #54807.
I'm leaving this in Draft while testing more extensively 🚀