Skip to content

Commit ea0710f

Browse files
committed
test: tolerate async block count updates in test-fs-stat-bigint
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
1 parent 4fa5145 commit ea0710f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎test/parallel/test-fs-stat-bigint.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ function verifyStats(bigintStats, numStats, allowableDelta) {
7878
`Number version ${key} = ${msFromNum}, ` +
7979
`BigInt version ${nsKey} = ${nsFromBigInt}n` +
8080
` = ${msFromBigIntNs}ms, Allowable delta = ${allowableDelta}`);
81+
} else if (key === 'blocks') {
82+
// Some file systems (e.g. ZFS on SmartOS) update the block count of a
83+
// freshly written file asynchronously, so it can change between the
84+
// two stat() calls.
85+
assert.strictEqual(typeof bigintStats[key], 'bigint');
86+
assert(bigintStats[key] >= 0n);
8187
} else if (Number.isSafeInteger(val)) {
8288
assert.strictEqual(
8389
bigintStats[key], BigInt(val),

0 commit comments

Comments
 (0)