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>
This commit is contained in:
Marcel authored and Antoine du Hamel committed 2026-11-21 14:47:06 +01:00
1 parent 472d501591
commit 01bdf3f4cc
2 files changed
+11 -2

No files matched your search

+9 -1
View File
@@ -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
+2 -1
View File
@@ -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;
}