Skip to content

test: remove interval and give more time to unsync - #55006

Merged
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
pmarchini:issue/54807
Sep 24, 2024
Merged

test: remove interval and give more time to unsync#55006
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
pmarchini:issue/54807

Conversation

@pmarchini

Copy link
Copy Markdown
Member

This PR should address #54807.

I'm leaving this in Draft while testing more extensively 🚀

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@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 19, 2024
@pmarchini
pmarchini marked this pull request as ready for review September 19, 2024 10:25
@avivkelleravivkeller added the test_runner Issues and PRs related to the test runner subsystem. label Sep 19, 2024
Comment on lines +79 to +82
await new Promise((resolve) => setTimeout(() => {
unlinkSync(fileToDeletePathLocal);
resolve();
}, common.platformTimeout(1000)));

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
MemberAuthor

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 😁

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
MemberAuthor

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 😁

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

just update 😁

@codecov

codecovBot commented Sep 19, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.25%. Comparing base (0d4387e) to head (e654e80).
Report is 483 commits behind head on main.

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 

see 108 files with indirect coverage changes

@jasnelljasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 21, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 21, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with some minor comments.

If this fixes #54807, can you add that to this PR so that the issue gets closed.

Comment on lines +18 to +20
function wait(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can use setTimeout() from node:timers/promises for this exact functionality.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

done 😁

Comment threadtest/parallel/test-runner-watch-mode-complex.mjs

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@cjihrigcjihrig added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 21, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 21, 2024
@nodejs-github-bot

This comment was marked as outdated.

@jakecastelli

Copy link
Copy Markdown
Member

I see this test fail a lot on windows platform, could we queue a stress test?

@aduh95

aduh95 commented Sep 23, 2024

Copy link
Copy Markdown
Contributor

Stress test CI: https://ci.nodejs.org/view/Stress/job/node-stress-single-test/538/ 🟢

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@mcollinamcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 24, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 24, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

nodejs-github-bot commented Sep 24, 2024

Copy link
Copy Markdown
Collaborator

@cjihrigcjihrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed needs-ci PRs that need a full CI run. labels Sep 24, 2024
@cjihrigcjihrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 24, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 24, 2024
@nodejs-github-bot
nodejs-github-bot merged commit 02e8972 into nodejs:mainSep 24, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 02e8972

targos pushed a commit that referenced this pull request Oct 4, 2024
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>
@aduh95aduh95 mentioned this pull request Oct 9, 2024
lpinca added a commit to lpinca/node that referenced this pull request Jan 4, 2025
nodejs-github-bot pushed a commit that referenced this pull request Jan 6, 2025
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>
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.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.test_runnerIssues and PRs related to the test runner subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@pmarchini@nodejs-github-bot@jakecastelli@aduh95@mcollina@jasnell@cjihrig@avivkeller@marco-ippolito