Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pmarchini
Copy link
Contributor

This PR should address #54807.

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

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@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 19, 2024
@pmarchini pmarchini marked this pull request as ready for review September 19, 2024 10:25
@RedYetiDev RedYetiDev 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
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
Contributor Author

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
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
Contributor Author

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

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.03%. Comparing base (0d4387e) to head (9daffe6).
Report is 5 commits behind head on main.

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     

see 37 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants