diff --git a/tests/Anubis.Tests/HealthEndpointTests.cs b/tests/Anubis.Tests/HealthEndpointTests.cs index 82c509e..915a80a 100644 --- a/tests/Anubis.Tests/HealthEndpointTests.cs +++ b/tests/Anubis.Tests/HealthEndpointTests.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using System.Net; using System.Net.Http.Json; using Anubis.Server; @@ -37,10 +38,12 @@ public sealed class HealthEndpointTests return (await response.Content.ReadFromJsonAsync())!; } + // 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) { 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(); if (last.Status == status && last.Checks!.GetValueOrDefault("motore") == loop)