flaky test fix (#1392)

This commit is contained in:
Konstantin Konstantinov 2026-01-16 12:48:51 +02:00 • committed by GitHub
commit 8bf13e4569
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2291,6 +2291,11 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
const { done } = await Promise.race([readPromise, timeoutPromise]);
expect(done).toBe(true);
// Wait a bit to ensure the next notification gets a different timestamp.
// The eventStore uses Date.now() in event IDs, and if two events have the same
// timestamp, the UUID suffix ordering is random and may not preserve creation order.
await new Promise(resolve => setTimeout(resolve, 5));
// Send a notification while client is disconnected
await mcpServer.server.sendLoggingMessage({ level: 'info', data: 'Missed while disconnected' });