Skip to content

fs: fix rmSync error code - #57103

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
koplas:error-typo
Feb 25, 2025
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
koplas:error-typo

Conversation

@koplas

@koplas koplas commented Feb 17, 2025

Copy link
Copy Markdown

Return the correct error code, when a directory_not_empty error occurred.

Fixes: #57095

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Feb 17, 2025

@jazelly jazelly 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.

LGTM. Can you please add a test

@koplas

koplas commented Feb 17, 2025 •

Copy link
Copy Markdown
Author

It doesn't seem very easy to test. This error only occurs for me if some files were added to the folder while RmSync was called. Reproducing this can result in flaky tests, as the error condition is timing-dependent.
I will take a look at how to reproduce this error reliably.

Update: There is already a test for this that is now failing. I will update the test.

jazelly