Skip to content

test: add failing test for recursive mkdir on read-only fs#1

Open
kennyhyun wants to merge 2 commits intomainfrom
fix/mkdirp-EROFS
Open

test: add failing test for recursive mkdir on read-only fs#1
kennyhyun wants to merge 2 commits intomainfrom
fix/mkdirp-EROFS

Conversation

@kennyhyun
Copy link
Copy Markdown
Owner

@kennyhyun kennyhyun commented Apr 8, 2026

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

@kennyhyun kennyhyun force-pushed the fix/mkdirp-EROFS branch 5 times, most recently from 38076da to b325e62 Compare April 12, 2026 05:57
kennyhyun and others added 2 commits April 12, 2026 17:51
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant