Skip to content

fs: ensure dir.read() does not throw synchronously #58228

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

Merged
merged 1 commit into from
May 10, 2025

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented May 8, 2025

It's the promise version, it should return a rejected Promise, not throw.

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels May 8, 2025
Copy link

codecov bot commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.20%. Comparing base (dc7ec42) to head (942862f).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58228      +/-   ##
==========================================
+ Coverage   90.18%   90.20%   +0.01%     
==========================================
  Files         629      629              
  Lines      186641   186641              
  Branches    36654    36667      +13     
==========================================
+ Hits       168329   168353      +24     
- Misses      11112    11115       +3     
+ Partials     7200     7173      -27     
Files with missing lines Coverage Δ
lib/internal/fs/dir.js 94.18% <100.00%> (-0.88%) ⬇️

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LiviaMedeiros LiviaMedeiros added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 8, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 8, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@@ -188,7 +188,7 @@ async function doAsyncIterThrowTest() {
}
}

await assert.rejects(async () => dir.read(), dirclosedError);
await assert.rejects(dir.read(), dirclosedError);
Copy link
Member

Choose a reason for hiding this comment

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

hmm, the title says dir.close() but the tests are looking at dir.read() with the dirclosedError. Just a bit confusing. Some additional code comments could help

@aduh95 aduh95 changed the title fs: ensure dir.close() does not throw synchronously fs: ensure dir.read() does not throw synchronously May 9, 2025
aduh95 added a commit to aduh95/node that referenced this pull request May 10, 2025
PR-URL: nodejs#58228
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@aduh95 aduh95 force-pushed the dir-close-async branch from 7b2ad0b to 565e5e1 Compare May 10, 2025 08:37
PR-URL: nodejs#58228
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@aduh95 aduh95 force-pushed the dir-close-async branch from 565e5e1 to 942862f Compare May 10, 2025 08:37
@aduh95 aduh95 merged commit 942862f into nodejs:main May 10, 2025
19 checks passed
targos pushed a commit that referenced this pull request May 16, 2025
PR-URL: #58228
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants