test: fix 2nd flaky blob test case

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64391
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Tim Perry authored and GitHub committed 2026-07-12 15:11:38 +00:00
1 parent 47b6ef28e6
commit dca0fd1b69
1 file changed
+3 -1
+3 -1
View File
@@ -384,7 +384,9 @@ assert.throws(() => new Blob({}), {
assert.strictEqual(value.byteLength, 5);
assert(!done);
setTimeout(common.mustCall(() => {
assert.strictEqual(stream[kState].controller.desiredSize, 0);
// Same setImmediate() pull vs. timer race as the non-BYOB case above:
// the stream may already have pulled the next 'hello' (5 bytes), hence -5.
assert([0, -5].includes(stream[kState].controller.desiredSize));
}), 0);
})().then(common.mustCall());