test: add failing test for recursive mkdir on read-only fs#1
Open
test: add failing test for recursive mkdir on read-only fs#1
Conversation
38076da to
b325e62
Compare
mkdirSync with { recursive: true } on a read-only filesystem
incorrectly throws ENOENT instead of the expected EROFS error.
Two test cases are included:
- On Linux with passwordless sudo, mounts a real read-only tmpfs to
verify the error code against the actual kernel behavior.
- Uses internalBinding to mock binding.mkdir and simulate EROFS,
ensuring the error propagates correctly without requiring root.
Refs: nodejs#47098
Refs: nodejs#48105
Signed-off-by: Kenny Yeo <kenny@yeoyou.net>
Add UV_EROFS to the list of errors that should be returned immediately in MKDirpSync and MKDirpAsync, preventing it from being incorrectly converted to ENOENT when mkdir is called with the recursive option on a read-only filesystem. Based on the original fix by Alberto Moretti (@hiimjako) in nodejs#48105. Refs: nodejs#47098 Refs: nodejs#48105 Co-authored-by: Alberto Moretti <moretti919@gmail.com> Signed-off-by: Kenny Yeo <kenny@yeoyou.net>
b325e62 to
03345ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mkdirSync with { recursive: true } on a read-only filesystem throws ENOENT instead of the expected EROFS. This test demonstrates the bug by mounting a read-only tmpfs via sudo and verifying the error code.
Refs: nodejs#47098
Refs: nodejs#48105
just for testing failing pipeline