diff --git a/test/parallel/test-fs-stat-date.mjs b/test/parallel/test-fs-stat-date.mjs index 979f6d5f453cd1..71cdb1a40f986b 100644 --- a/test/parallel/test-fs-stat-date.mjs +++ b/test/parallel/test-fs-stat-date.mjs @@ -31,6 +31,14 @@ function closeEnough(actual, expected, margin) { if (process.arch === 'ppc64') { margin += 1000; } + + // Filesystems without support for timestamps before 1970-01-01, such as NFSv3, + // should return 0 for negative numbers. Do not treat it as error. + if (actual === 0 && expected < 0) { + console.log(`ignored 0 while expecting ${expected}`); + return; + } + assert.ok(Math.abs(Number(actual - expected)) < margin, `expected ${expected} ± ${margin}, got ${actual}`); }