Skip to content

Commit 2f7f55e

Browse files
committed
test: fix on zfs build host
1 parent 924250d commit 2f7f55e

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎test/parallel/test-fileurltopathbuffer.js‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ assert.throws(() => writeFileSync(testPath, 'test'), {
5555
name: 'URIError',
5656
});
5757

58-
writeFileSync(testPathBuffer, 'test');
58+
59+
try {
60+
writeFileSync(testPathBuffer, 'test');
61+
} catch (e) {
62+
// ZFS with utf8only=on (default) rejects non-UTF-8 file names
63+
if (e.code === 'EILSEQ')
64+
common.skip('test requires filesystem that accepts non-UTF-8 names');
65+
throw e;
66+
}
5967
assert.ok(existsSync(testPathBuffer));
6068

6169
// Using fileURLToPath fails because the URL contains non-Unicode

‎test/parallel/test-fs-readdir-ucs2.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const fullpath = Buffer.concat([root, filebuff]);
1818
try {
1919
fs.closeSync(fs.openSync(fullpath, 'w+'));
2020
} catch (e) {
21-
if (e.code === 'EINVAL')
21+
// EILSEQ: ZFS with utf8only=on (default) rejects non-UTF-8 file names
22+
if (e.code === 'EINVAL' || e.code === 'EILSEQ')
2223
common.skip('test requires filesystem that supports UCS2');
2324
throw e;
2425
}

0 commit comments

Comments
 (0)