Keep the test databases of the CI in memory
ci / test (postgres) (push) Successful in 6m54s
ci / test (sqlite) (push) Successful in 5m17s
ci / test (postgres) (pull_request) Successful in 6m51s
ci / test (sqlite) (pull_request) Successful in 7m17s
ci / image (push) Successful in 1m0s
ci / image (pull_request) Successful in 1m40s
ci / test (postgres) (push) Successful in 6m54s
ci / test (sqlite) (push) Successful in 5m17s
ci / test (postgres) (pull_request) Successful in 6m51s
ci / test (sqlite) (pull_request) Successful in 7m17s
ci / image (push) Successful in 1m0s
ci / image (pull_request) Successful in 1m40s
The disk of the runner stops for seconds under load, and the health check of a test rightly answered "unavailable" after five. PostgreSQL was already spared the syncs (ADR 0015); the SQLite tests now use a temporary folder in memory, and the health test looks at the answer it settles on (ADR 0019). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3da9b00f44
commit
e8b3500db6
3 files changed
+42
-3
No files matched your search
@@ -439,8 +439,17 @@ public sealed class ServerTests
|
||||
var (env, postgres) = await ServerHarness.DockerOnEngineAsync();
|
||||
await using var engine = postgres;
|
||||
await using var server = await ServerHarness.StartAsync("docker", env);
|
||||
var health = await server.Http.GetFromJsonAsync<HealthResponse>(new Uri("/health", UriKind.Relative));
|
||||
Assert.AreEqual("ok", health!.Status);
|
||||
|
||||
// A computer stopped for more than the five seconds of the check is told unhealthy, as it should: here the
|
||||
// answer that counts is the one it settles on, within thirty seconds.
|
||||
HealthResponse? health = null;
|
||||
for (var watch = System.Diagnostics.Stopwatch.StartNew(); health?.Status != "ok" && watch.Elapsed < TimeSpan.FromSeconds(30); await Task.Delay(100))
|
||||
{
|
||||
using var response = await server.GetAsync("/health");
|
||||
health = await response.Content.ReadFromJsonAsync<HealthResponse>();
|
||||
}
|
||||
|
||||
Assert.AreEqual("ok", health!.Status, string.Join(", ", health.Checks!.Select(c => c.Key + " " + c.Value)));
|
||||
Assert.AreEqual("ok", health.Checks!["database"]);
|
||||
Assert.AreEqual("ok", health.Checks["scheduler"]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user