Skip to content

Commit 199f132

Browse files
committed
fix: Increase timeout and add delay in notification registry test to prevent race conditions
1 parent 69d4948 commit 199f132

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/notification-registry.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,18 +248,25 @@ describe('Notification Registry and Unified Subscription', () => {
248248
await Promise.all([
249249
waitForCondition(
250250
() => receivedNotifications[channels.item].length >= 4,
251-
3000
251+
5000
252252
),
253253
waitForCondition(
254254
() => receivedNotifications[channels.list].length >= 2,
255-
3000
255+
5000
256256
),
257257
waitForCondition(
258258
() => receivedNotifications[channels.uwu].length >= 1,
259-
3000
259+
5000
260260
)
261261
]);
262262

263+
// Add a small delay to ensure all notifications are processed
264+
await new Promise(resolve => setTimeout(resolve, 500));
265+
266+
// Log received notifications for debugging
267+
console.log(`Item notifications received: ${receivedNotifications[channels.item].length}`);
268+
console.log('Item operations:', receivedNotifications[channels.item].map(n => n.operation));
269+
263270
// Verify we got the correct number of notifications for each channel
264271
expect(receivedNotifications[channels.item].length).toBe(4);
265272
expect(receivedNotifications[channels.list].length).toBe(2);

0 commit comments

Comments
 (0)