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>
This commit is contained in:
Rafael Gonzaga authored and GitHub committed 2026-10-10 08:29:37 +00:00
1 parent ae5a0f40b5
commit 45b9f05c5e
1 file changed
+6
+6
View File
@@ -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),