Fase 13 — Campionato: unità di lavoro, piano e statistica #188
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using Anubis.Server;
|
using Anubis.Server;
|
||||||
@@ -37,10 +38,12 @@ public sealed class HealthEndpointTests
|
|||||||
return (await response.Content.ReadFromJsonAsync<HealthResponse>())!;
|
return (await response.Content.ReadFromJsonAsync<HealthResponse>())!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Up to 30 seconds of wall time: on a busy test runner the engine can take more than ten to start.
|
||||||
async Task UntilAsync(string status, string loop)
|
async Task UntilAsync(string status, string loop)
|
||||||
{
|
{
|
||||||
HealthResponse? last = null;
|
HealthResponse? last = null;
|
||||||
for (var i = 0; i < 100; i++)
|
var deadline = Stopwatch.StartNew();
|
||||||
|
while (last is null || deadline.Elapsed < TimeSpan.FromSeconds(30))
|
||||||
{
|
{
|
||||||
last = await HealthAsync();
|
last = await HealthAsync();
|
||||||
if (last.Status == status && last.Checks!.GetValueOrDefault("motore") == loop)
|
if (last.Status == status && last.Checks!.GetValueOrDefault("motore") == loop)
|
||||||
|
|||||||
Reference in new issue
Block a user