We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 878a660 commit 0fdbe83Copy full SHA for 0fdbe83
test/integration/v2/stream.test.ts
@@ -457,14 +457,16 @@ describe("streams", () => {
457
);
458
}
459
460
- // Simulate backpressure with 1ms delay every 1000 chunks
+ // Simulate backpressure with synchronous delay every 1000 chunks
461
if (processedChunks % 1000 === 0) {
462
- setTimeout(() => {
463
- callback();
464
- }, 1);
465
- } else {
466
+ // Create a small synchronous delay using a busy loop
+ // This simulates processing time without breaking pipeline completion
+ const start = Date.now();
+ while (Date.now() - start < 1) {
+ // 1ms busy wait
467
+ }
468
469
+ callback();
470
} catch (err) {
471
console.error("[DEBUG] Error in output stream:", err);
472
callback(err as Error);
0 commit comments