mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
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:
1 parent
ae5a0f40b5
commit
45b9f05c5e
1 file changed
+6
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user