Skip to content

Commit 3f69eae

Browse files
committed
chore: attempt to address node 18 test failure
1 parent 1e0b11e commit 3f69eae

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/integration-tests/taskResumability.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,14 @@ describe('Transport resumability', () => {
193193
}
194194
);
195195

196-
// Wait for some notifications to arrive (not all) - shorter wait time
197-
await new Promise(resolve => setTimeout(resolve, 20));
196+
// Fix for node 18 test failures, allow some time for notifications to arrive
197+
const maxWaitTime = 2000; // 2 seconds max wait
198+
const pollInterval = 10; // Check every 10ms
199+
const startTime = Date.now();
200+
while (notifications.length === 0 && Date.now() - startTime < maxWaitTime) {
201+
// Wait for some notifications to arrive (not all) - shorter wait time
202+
await new Promise(resolve => setTimeout(resolve, pollInterval));
203+
}
198204

199205
// Verify we received some notifications and lastEventId was updated
200206
expect(notifications.length).toBeGreaterThan(0);

0 commit comments

Comments
 (0)