Commit f8dd0aae2ff for nodejs
commit f8dd0aae2ff652c174faf14394b968c4b846db2d
Author: Marcel <34819524+MarcelCoding@users.noreply.github.com>
Date: Wed Nov 18 12:43:12 2026 +0100
test: fix on zfs build host
Signed-off-by: Marcel <me@m4rc3l.de>
PR-URL: https://github.com/nodejs/node/pull/67517
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
diff --git a/test/parallel/test-fileurltopathbuffer.js b/test/parallel/test-fileurltopathbuffer.js
index 11a78b76c0e..db6bdc532a0 100644
--- a/test/parallel/test-fileurltopathbuffer.js
+++ b/test/parallel/test-fileurltopathbuffer.js
@@ -55,7 +55,15 @@ assert.throws(() => writeFileSync(testPath, 'test'), {
name: 'URIError',
});
-writeFileSync(testPathBuffer, 'test');
+
+try {
+ writeFileSync(testPathBuffer, 'test');
+} catch (e) {
+ // ZFS with utf8only=on (default) rejects non-UTF-8 file names
+ if (e.code === 'EILSEQ')
+ common.skip('test requires filesystem that accepts non-UTF-8 names');
+ throw e;
+}
assert.ok(existsSync(testPathBuffer));
// Using fileURLToPath fails because the URL contains non-Unicode
diff --git a/test/parallel/test-fs-readdir-ucs2.js b/test/parallel/test-fs-readdir-ucs2.js
index 264858ec6ae..b541ecd32f5 100644
--- a/test/parallel/test-fs-readdir-ucs2.js
+++ b/test/parallel/test-fs-readdir-ucs2.js
@@ -18,7 +18,8 @@ const fullpath = Buffer.concat([root, filebuff]);
try {
fs.closeSync(fs.openSync(fullpath, 'w+'));
} catch (e) {
- if (e.code === 'EINVAL')
+ // EILSEQ: ZFS with utf8only=on (default) rejects non-UTF-8 file names
+ if (e.code === 'EINVAL' || e.code === 'EILSEQ')
common.skip('test requires filesystem that supports UCS2');
throw e;
}