fix(comm): key site liveness on central receive time; gRPC connect timeout + connect-phase deadline failover (COMM-4, COMM-5, WP4 task 4.4)
This commit is contained in:
@@ -353,6 +353,22 @@ public class CentralHealthAggregatorTests
|
||||
Assert.True(_aggregator.GetSiteState("site-1")!.IsOnline);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// COMM-4 regression: a heartbeat stamped in central's future (a fast site clock) must not
|
||||
/// extend the offline timeout by the skew — it is clamped to central's now.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MarkHeartbeat_FutureStamp_DoesNotDelayOfflineDetection()
|
||||
{
|
||||
_aggregator.ProcessReport(MakeReport("site-1", 1));
|
||||
_aggregator.MarkHeartbeat("site-1", _timeProvider.GetUtcNow().AddMinutes(30));
|
||||
|
||||
_timeProvider.Advance(TimeSpan.FromSeconds(61));
|
||||
_aggregator.CheckForOfflineSites();
|
||||
|
||||
Assert.False(_aggregator.GetSiteState("site-1")!.IsOnline);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Regression test: an offline-to-online transition must
|
||||
/// be backed by a fresh LastHeartbeatAt. Previously MarkHeartbeat used
|
||||
|
||||
Reference in New Issue
Block a user