Skip to content

Commit 8bf13e4

Browse files
flaky test fix (#1392)
1 parent 17a2c39 commit 8bf13e4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/middleware/node/test/streamableHttp.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,11 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
22912291
const { done } = await Promise.race([readPromise, timeoutPromise]);
22922292
expect(done).toBe(true);
22932293

2294+
// Wait a bit to ensure the next notification gets a different timestamp.
2295+
// The eventStore uses Date.now() in event IDs, and if two events have the same
2296+
// timestamp, the UUID suffix ordering is random and may not preserve creation order.
2297+
await new Promise(resolve => setTimeout(resolve, 5));
2298+
22942299
// Send a notification while client is disconnected
22952300
await mcpServer.server.sendLoggingMessage({ level: 'info', data: 'Missed while disconnected' });
22962301

0 commit comments

Comments
 (0)