add naming option + other stuff

This commit is contained in:
2026-03-25 10:14:07 -07:00
parent ef0da7582c
commit 7f395bd9b3
2 changed files with 139 additions and 36 deletions

View File

@@ -121,6 +121,8 @@ pkgs.testers.runNixOSTest {
dataDir = "/var/lib/sonarr/.config/NzbDrone";
port = 8989;
healthChecks = true;
healthCheckRetries = 2;
healthCheckInterval = 2;
downloadClients = [
{
name = "qBittorrent";
@@ -145,6 +147,8 @@ pkgs.testers.runNixOSTest {
dataDir = "/var/lib/radarr/.config/Radarr";
port = 7878;
healthChecks = true;
healthCheckRetries = 2;
healthCheckInterval = 2;
downloadClients = [
{
name = "qBittorrent";
@@ -170,6 +174,8 @@ pkgs.testers.runNixOSTest {
port = 9696;
apiVersion = "v1";
healthChecks = true;
healthCheckRetries = 2;
healthCheckInterval = 2;
syncedApps = [
{
name = "Sonarr";
@@ -288,23 +294,26 @@ pkgs.testers.runNixOSTest {
timeout=30,
)
with subtest("Health check fails when Prowlarr synced app is unreachable"):
with subtest("Health check fails with retries when Prowlarr synced app is unreachable"):
# Stop radarr to ensure synced apps are unreachable
# (sonarr is already stopped since sonarr-init was pulled down above)
machine.succeed("systemctl stop radarr.service")
machine.succeed("systemctl stop sonarr.service || true")
machine.succeed("systemctl stop radarr.service || true")
# Restart prowlarr-init - it should FAIL because synced app connectivity test fails
# even after retries (2 retries * 2s interval = ~4s + attempt time)
machine.execute("systemctl restart prowlarr-init.service")
# Wait for the service to settle into failed state
# Prowlarr's testall may take up to 30s (--max-time) per attempt, plus restart delay
# With retries: up to 3 attempts * (30s max-time + 2s interval) + restart delay
machine.wait_until_succeeds(
"systemctl show prowlarr-init.service --property=Result | grep -q 'exit-code'",
timeout=120,
timeout=300,
)
journal = machine.succeed("journalctl -u prowlarr-init.service --no-pager")
assert "health check failed" in journal.lower(), \
"Expected health check failure message in prowlarr-init journal, got: " + journal[-500:]
assert "retrying" in journal.lower(), \
"Expected retry log messages before final failure in prowlarr-init journal, got: " + journal[-500:]
'';
}