diff --git a/src/main/runtime/remote-runtime-request-connection.integration.test.ts b/src/main/runtime/remote-runtime-request-connection.integration.test.ts index d59cdecbc30..9d6c3920b55 100644 --- a/src/main/runtime/remote-runtime-request-connection.integration.test.ts +++ b/src/main/runtime/remote-runtime-request-connection.integration.test.ts @@ -428,12 +428,14 @@ describe('remote runtime request connection integration', () => { }) }) ) + // Why: CI can register subscription cleanups before the first + // response crosses the shared-control socket. await waitFor( - () => subscriptionCleanups.size >= mixedSubscriptions.length + 1, + () => + subscriptionCleanups.size >= mixedSubscriptions.length + 1 && mixedEvents.length > 0, 5000, () => `cleanup count ${subscriptionCleanups.size}, event count ${mixedEvents.length}` ) - expect(mixedEvents.length).toBeGreaterThan(0) expect( (server as unknown as { wsConnectionIds: Map }).wsConnectionIds.size ).toBe(1)