Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 728444f

Browse files
committed
chore(core): fix broadcast race condition (#1284)
1 parent dc88c71 commit 728444f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/rivetkit/src/driver-test-suite/tests/actor-conn.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,11 @@ export function runActorConnTests(driverTestConfig: DriverTestConfig) {
124124
receivedEvents.push(count);
125125
});
126126

127-
// Trigger broadcast events
128-
await connection.increment(5);
129-
await connection.increment(3);
130-
127+
// HACK: Race condition between subscribing & sending events in SSE
131128
// Verify events were received
132-
await vi.waitFor(() => {
129+
await vi.waitFor(async () => {
130+
await connection.setCount(5);
131+
await connection.setCount(8);
133132
expect(receivedEvents).toContain(5);
134133
expect(receivedEvents).toContain(8);
135134
});

0 commit comments

Comments
 (0)