fix(ext/node): enable node:fs compat tests + lchmod fix#32892
Merged
bartlomieju merged 7 commits intomainfrom Mar 23, 2026
Merged
fix(ext/node): enable node:fs compat tests + lchmod fix#32892bartlomieju merged 7 commits intomainfrom
bartlomieju merged 7 commits intomainfrom
Conversation
Enable 64 previously-disabled node:fs compatibility tests that now pass without any code changes. These cover: - append-file, chown, close-errors, constants, copyfile - fchmod, fchown, fmap, lchown, mkdir, open-mode-mask - promises (chmod, readFile, stat, stream, sync, truncate, write, writefile, watch-iterator, readfile-with-fd, writefile-with-fd, statfs-validate-path) - read, readdir, readfile, readv, realpath, rmdir, rmSync - stream (construct-compat, destroy, double-close) - symlink, timestamp, truncate, utimes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enable test-fs-write-stream-throw-type-error, test-fs-write-no-fd, test-fs-writev, test-fs-writev-sync, test-fs-write-file-flush, test-fs-write-sync. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
promises.lchmod was throwing validation errors synchronously instead of returning rejected promises. Adding async keyword ensures parseFileMode errors become promise rejections, matching Node.js behavior where assert.rejects can catch them. Enables parallel/test-fs-lchmod.js compat test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enable test-fs-promises-file-handle-writeFile, test-fs-readfile-unlink, test-fs-readfile-zero-byte-liar, test-fs-rename-type-check, test-fs-stat-bigint, test-fs-symlink-dir, test-fs-symlink, test-fs-whatwg-url, test-fs-write-buffer, test-fs-write-buffer-large, test-fs-write-file-invalid-path, test-fs-write-file-typedarrays, test-fs-write-file, test-fs-write-stream-encoding, test-fs-write-stream-file-handle-2, test-fs-write-stream-file-handle, test-fs-write-stream-patch-open. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When fileHandle.read(buffer) is called without an options argument, pass an empty options object to readAsync instead of undefined, which was causing a validation error. This also handles fileHandle.read(buffer, options) where options may be undefined. Enables parallel/test-fs-promises-write-optional-params.js. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…bols - Add getValidatedFd() call to fstat and fstatSync to properly validate the file descriptor, throwing ERR_INVALID_ARG_TYPE for invalid types like strings, booleans, etc. - Fix isInt32() to guard against Symbols which would throw "Cannot convert a Symbol value to a number" when doing bitwise OR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Disable test-fs-write-file-flush.js (flaky on all platforms) - Disable test-fs-readdir-ucs2.js (fails on Linux CI) - Disable test-fs-realpath-on-substed-drive.js (Windows-only test) - Add windows: false for Unix-specific tests: chown-negative-one, fchown-negative-one, lchown-negative-one, mkdir-recursive-eaccess, open-mode-mask, symlink-longpath Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b8089f0 to
04e6967
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.
Summary
Enable 87 previously-disabled
node:fscompatibility tests that now pass.Code fix
asyncso validation errors become rejected promises instead of synchronous throws, matching Node.js behavior whereassert.rejectscan catch them.Newly enabled tests (87 total)
Covers: append-file, chown, close-errors, constants, copyfile, fchmod, fchown, fmap, lchmod, lchown, mkdir, open-mode-mask, promises (chmod, readFile, stat, stream, sync, truncate, write, writeFile, readfile-with-fd, writefile-with-fd, statfs-validate-path, watch-iterator), read, readdir, readfile, readv, realpath, rename, rmdir, rmSync, sir-writes-alot, stream (construct-compat, destroy, double-close), symlink, timestamp, truncate, utimes, whatwg-url, write, write-buffer, write-file, write-stream, writev.
Test plan
🤖 Generated with Claude Code