WorkerClient heartbeat loop ignores the injected TimeProvider #217

Closed
opened 2026-11-09 12:41:06 -05:00 by dohertj2 · 1 comment
Owner

WorkerClient.HeartbeatLoopAsync waits with a plain Task.Delay instead of the injected _timeProvider, so heartbeat-check behaviour cannot be driven with a fake clock in tests (the archreview GWC-20 design included this; #192's text did not, so it was left). Switch to Task.Delay(interval, _timeProvider, ct) and add a fake-time test for stuck/grace detection.

`WorkerClient.HeartbeatLoopAsync` waits with a plain `Task.Delay` instead of the injected `_timeProvider`, so heartbeat-check behaviour cannot be driven with a fake clock in tests (the archreview GWC-20 design included this; #192's text did not, so it was left). Switch to `Task.Delay(interval, _timeProvider, ct)` and add a fake-time test for stuck/grace detection.
dohertj2 added the area:gatewaytype:testpriority:p3 labels 2026-11-09 12:41:06 -05:00
Author
Owner

Fixed on main b5d11e58: WorkerClient.HeartbeatLoopAsync uses Task.Delay(interval, _timeProvider, ct). New fake-clock grace-then-fault test; the within-stuck-ceiling test moved to fake time (new TestSupport/TickObservingTimeProvider). Both fail (5 s timeouts) with the fix reverted; stable over 10 repeated runs. Evidence: NonWindows.slnx 0 warnings/0 errors; MxGateway.Tests 1395 passed / 2 skipped / 0 failed (after rebase on main).

Fixed on main b5d11e58: WorkerClient.HeartbeatLoopAsync uses `Task.Delay(interval, _timeProvider, ct)`. New fake-clock grace-then-fault test; the within-stuck-ceiling test moved to fake time (new TestSupport/TickObservingTimeProvider). Both fail (5 s timeouts) with the fix reverted; stable over 10 repeated runs. Evidence: NonWindows.slnx 0 warnings/0 errors; MxGateway.Tests 1395 passed / 2 skipped / 0 failed (after rebase on main).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/mxaccessgw#217