Skip to content

Commit afca7b5

Browse files
committed
test(redis): assert the fresh subscribe by channel, not by call count
A reconnect also re-subscribes surviving channels, so the new subscription is identified by its channel rather than by SUBSCRIBE having been issued once.
1 parent cc95778 commit afca7b5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/sim/lib/execution/execution-signal.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,12 @@ describe('ExecutionSignalHub', () => {
463463
connection.status = 'ready'
464464
connection.client?.emit('ready')
465465
await again
466-
expect(mockSubscribe).toHaveBeenCalledOnce()
466+
// The reconnect also re-subscribes the surviving channel; what matters is
467+
// that the new one went out only once readiness was genuinely observed.
468+
expect(mockSubscribe).toHaveBeenCalledWith(
469+
'execution:signal:execution-again',
470+
'execution:cancel'
471+
)
467472
expect(connection.client?.listenerCount('ready')).toBe(1)
468473
expect(vi.getTimerCount()).toBe(0)
469474
} finally {

0 commit comments

Comments
 (0)