From 01bdf3f4ccbea9e573f53c1e668feb875d020618 Mon Sep 17 00:00:00 2001 From: Marcel <34819524+MarcelCoding@users.noreply.github.com> Date: Wed, 18 Nov 2026 12:43:12 +0100 Subject: [PATCH] test: fix on zfs build host Signed-off-by: Marcel PR-URL: https://github.com/nodejs/node/pull/67517 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- test/parallel/test-fileurltopathbuffer.js | 10 +++++++++- test/parallel/test-fs-readdir-ucs2.js | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) 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; }