The MxGateway.Tests part of #223 (the Worker.Tests items are handled separately).
- DashboardSnapshotFeed gains two internal test seams: WhenIdleGateClosedAsync, a
TCS-backed signal that completes once no pump generation is accepting subscribers,
and IsPumpIdle (no live generation and the latest pump has exited). The TCS is created
lazily by a waiter, so production never allocates it.
- WatchAsync_WhenAJoinerLeavesWhileAnOldGenerationLingers_LeavesNoPumpRunning drops both
150 ms real sleeps: it waits on the idle-gate signal for the joiner's unsubscribe, and
asserts IsPumpIdle before the orphan-push check, which is then immediate. Reverting the
per-generation idle check to the old global "list is empty" check now fails the test
(5 s TimeoutException on the gate), where before the sleep simply elapsed.
- Eventually.WaitUntilAsync/WaitForAsync take an optional description (defaulting to the
condition's source text via CallerArgumentExpression) for the timeout message, and gain an
async-condition overload. The hand-rolled polling loops in EventStreamServiceTests,
GatewaySessionDashboardMirrorTests, DashboardEventBroadcasterTests and
AlarmsPageTruncationBannerTests now delegate to it, keeping their timeouts and messages.
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
DashboardSnapshotPublisher takes an optional TimeProvider (default
TimeProvider.System) driving the idle poll, the reconnect delay and, via
BoundedHubSend, the send timeout. Its tests now run on a fake clock with
exact assertions (reconnect gap == delay, 25 idle polls pull nothing, a
wedged send is abandoned at the fake send timeout).
DashboardSnapshotFeed has no time dependence, so no seam was added; its
tests lose the 100 ms sleep and poll loops in favour of CountSignal
signals. The Task.Delay(25) poll copies in the alarm-monitor tests and
several 5-10 ms poll loops now share TestSupport/Eventually.
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV