Commit 45b9f05c5ee for nodejs
commit 45b9f05c5eec291da57eb83443adb23d4f5f6866
Author: Rafael Gonzaga <rafael.nunu@hotmail.com>
Date: Sat Oct 10 05:29:37 2026 -0300
test: tolerate async block count updates in test-fs-stat-bigint
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66576
Refs: https://github.com/nodejs/node/issues/57797
Refs: https://github.com/nodejs/reliability/issues/1657
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
diff --git a/test/parallel/test-fs-stat-bigint.js b/test/parallel/test-fs-stat-bigint.js
index ae8d3857dec..e70eff046b9 100644
--- a/test/parallel/test-fs-stat-bigint.js
+++ b/test/parallel/test-fs-stat-bigint.js
@@ -78,6 +78,12 @@ function verifyStats(bigintStats, numStats, allowableDelta) {
`Number version ${key} = ${msFromNum}, ` +
`BigInt version ${nsKey} = ${nsFromBigInt}n` +
` = ${msFromBigIntNs}ms, Allowable delta = ${allowableDelta}`);
+ } else if (key === 'blocks') {
+ // Some file systems (e.g. ZFS on SmartOS) update the block count of a
+ // freshly written file asynchronously, so it can change between the
+ // two stat() calls.
+ assert.strictEqual(typeof bigintStats[key], 'bigint');
+ assert(bigintStats[key] >= 0n);
} else if (Number.isSafeInteger(val)) {
assert.strictEqual(
bigintStats[key], BigInt(val),