Windows 0.3.4 connection resilience and fixed-grid source delta; no private history or other platform changes
This commit is contained in:
@@ -133,6 +133,43 @@ internal static class NodeHealthProbeSelfTest
|
||||
Require(await result, "Unused-probe cancellation changed the health verdict");
|
||||
});
|
||||
|
||||
await Check("http_5xx_response_proves_transport_but_not_business_health", () => {
|
||||
Require(NodeHealthProbe.AcceptsTransportStatus(503) && !NodeHealthProbe.Accepts(2, 503), "HTTP outage confused with proxy transport");
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
await Check("single_codex_outage_keeps_independent_transport_proof", async () => {
|
||||
var report = await NodeHealthProbe.AggregateReportAsync(new[] {
|
||||
Task.FromResult(new NodeHealthProbe.Observation(true, true)),
|
||||
Task.FromResult(new NodeHealthProbe.Observation(true, true)),
|
||||
Task.FromResult(new NodeHealthProbe.Observation(false, false)) }, CancellationToken.None, () => { });
|
||||
Require(!report.BusinessHealthy && report.TransportReachable, "Site failure must remain distinct from transport failure");
|
||||
});
|
||||
await Check("all_sites_return_5xx_still_is_not_transport_death", async () => {
|
||||
var report = await NodeHealthProbe.AggregateReportAsync(Enumerable.Range(0, 3)
|
||||
.Select(_ => Task.FromResult(new NodeHealthProbe.Observation(false, true))).ToArray(), CancellationToken.None, () => { });
|
||||
Require(!report.BusinessHealthy && report.TransportReachable, "HTTP responses lost transport proof");
|
||||
});
|
||||
await Check("transport_proof_does_not_wait_for_failed_codex", async () => {
|
||||
var pending = new TaskCompletionSource<NodeHealthProbe.Observation>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
var cancelled = false;
|
||||
var reached = await NodeHealthProbe.AggregateTransportAsync(new[] {
|
||||
Task.FromResult(new NodeHealthProbe.Observation(true, true)), pending.Task, pending.Task }, CancellationToken.None, () => cancelled = true)
|
||||
.WaitAsync(TimeSpan.FromSeconds(1));
|
||||
Require(reached && cancelled, "Transport startup unnecessarily waited for a site diagnostic");
|
||||
pending.SetException(new IOException("late site fixture"));
|
||||
});
|
||||
await Check("all_transport_failures_remain_unavailable", async () => {
|
||||
var report = await NodeHealthProbe.AggregateReportAsync(Enumerable.Range(0, 3)
|
||||
.Select(_ => Task.FromResult(default(NodeHealthProbe.Observation))).ToArray(), CancellationToken.None, () => { });
|
||||
Require(!report.BusinessHealthy && !report.TransportReachable, "Failed transport became false healthy");
|
||||
});
|
||||
await Check("transport_caller_cancellation_propagates", async () => {
|
||||
using var caller = new CancellationTokenSource(); caller.Cancel();
|
||||
var cancelled = false;
|
||||
try { await NodeHealthProbe.AggregateTransportAsync([], caller.Token, () => { }); }
|
||||
catch (OperationCanceledException error) { cancelled = error.CancellationToken == caller.Token; }
|
||||
Require(cancelled, "Transport cancellation was converted to false health");
|
||||
});
|
||||
var passed = checks.Values.All(value => value);
|
||||
var report = JsonSerializer.Serialize(new { kind = "node_health_early_completion", network_used = false,
|
||||
checks, errors, passed }, new JsonSerializerOptions { WriteIndented = true });
|
||||
|
||||
Reference in New Issue
Block a user