fix(health): acked SendAsync transport — report-loss counter restore is live, not dead code
This commit is contained in:
@@ -13,7 +13,11 @@ public class HealthReportSenderTests
|
||||
private class FakeTransport : IHealthReportTransport
|
||||
{
|
||||
public List<SiteHealthReport> SentReports { get; } = [];
|
||||
public void Send(SiteHealthReport report) => SentReports.Add(report);
|
||||
public Task SendAsync(SiteHealthReport report, CancellationToken cancellationToken)
|
||||
{
|
||||
SentReports.Add(report);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
private class FakeSiteIdentityProvider : ISiteIdentityProvider
|
||||
@@ -387,7 +391,7 @@ public class HealthReportSenderTests
|
||||
private int _callCount;
|
||||
public List<SiteHealthReport> SentReports { get; } = [];
|
||||
|
||||
public void Send(SiteHealthReport report)
|
||||
public Task SendAsync(SiteHealthReport report, CancellationToken cancellationToken)
|
||||
{
|
||||
var n = Interlocked.Increment(ref _callCount);
|
||||
if (n == 1)
|
||||
@@ -395,6 +399,7 @@ public class HealthReportSenderTests
|
||||
throw new InvalidOperationException("transport temporarily unavailable");
|
||||
}
|
||||
SentReports.Add(report);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user