Skip to content

Commit 010bdbf

Browse files
committed
use set immediate
1 parent 6922e13 commit 010bdbf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/integration/v2/stream.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const connectionParams = {
1313
engineName: process.env.FIREBOLT_ENGINE_NAME as string
1414
};
1515

16-
jest.setTimeout(500000);
16+
jest.setTimeout(350000);
1717

1818
describe("streams", () => {
1919
it("check sum from stream result", async () => {
@@ -404,11 +404,11 @@ describe("streams", () => {
404404
write(chunk, encoding, callback) {
405405
processedChunks++;
406406

407-
// Simulate occasional slow processing with minimal delays
408-
if (processedChunks % 2000 === 0) {
409-
setTimeout(() => {
407+
// Simulate occasional slow processing with event loop yielding
408+
if (processedChunks % 1000 === 0) {
409+
setImmediate(() => {
410410
callback();
411-
}, 1); // 1ms delay
411+
});
412412
} else {
413413
callback();
414414
}

0 commit comments

Comments
 (0)