diff --git a/tests/plausible/functional/test_health_check.py b/tests/plausible/functional/test_health_check.py index 7de3b3e..c2db0a3 100644 --- a/tests/plausible/functional/test_health_check.py +++ b/tests/plausible/functional/test_health_check.py @@ -12,8 +12,10 @@ from harness import http as harness_http # noqa: E402 def test_plausible_root_serves(live_app): """GET /api/health → 200 (clickhouse+postgres ready). - `/` itself 500s via auth_controller under DISABLE_AUTH, so it is NOT a - reliable health probe; the dedicated /api/health endpoint is. + `/` is NOT a reliable health probe (500s during datastore init; 302s to + /register once ready — and 500'd permanently under the pre-2026-06-11 + 62-char SECRET_KEY_BASE, see recipe_meta.EXTRA_ENV); the dedicated + /api/health endpoint is. """ url = f"https://{live_app}/api/health" status, _ = harness_http.retry_http_get(url, expect_status=(200,), max_wait=60, interval=3) diff --git a/tests/plausible/recipe_meta.py b/tests/plausible/recipe_meta.py index ff77f0a..9921646 100644 --- a/tests/plausible/recipe_meta.py +++ b/tests/plausible/recipe_meta.py @@ -7,9 +7,10 @@ HEALTH_OK = (200,) # `events_db` but the service is named `plausible_events_db`, so swarm applies no ordering) and returns # 500 until clickhouse + DB migrations finish — several minutes on a cold deploy. The dedicated # /api/health endpoint returns 200 with {"clickhouse":"ok","postgres":"ok","sites_cache":"ok"} only -# once both datastores are ready, so it is a true readiness probe; `/` is unreliable (500s during init, -# 302s once ready, so it cannot distinguish "not ready" from "ready"). Give a wide HTTP window so the -# health poll waits out that init. [v1 failed at HTTP_TIMEOUT=600 polling `/`.] +# once both datastores are ready, so it is a true readiness probe; `/` is unreliable (500s during init; +# 302s to /register once ready — and with the pre-2026-06-11 62-char SECRET_KEY_BASE every HTML render +# 500'd permanently, see EXTRA_ENV). Give a wide HTTP window so the health poll waits out that init. +# [v1 failed at HTTP_TIMEOUT=600 polling `/`.] DEPLOY_TIMEOUT = 1200 HTTP_TIMEOUT = 1200 @@ -17,8 +18,12 @@ HTTP_TIMEOUT = 1200 EXTRA_ENV = { "DISABLE_AUTH": "true", "DISABLE_REGISTRATION": "true", - # 64-char stable value for CI — plausible (Phoenix) requires >= 64 chars - "SECRET_KEY_BASE": "ccciplausibletestkeybase64charsexactlyforCIephemeral4567890123", + # Stable CI value, 68 chars — Phoenix's cookie session store requires >= 64 BYTES and raises + # `ArgumentError ... at least 64 bytes` → HTTP 500 on EVERY page render (HTML routes only; + # /api/* never touches the cookie store, so health + event tests were unaffected) if it is + # shorter. The previous value was 62 chars, which is why every page (and the app screenshot) + # 500'd while the API tiers all passed (phase-shot root cause, 2026-06-11). + "SECRET_KEY_BASE": "ccciplausibletestkeybase64charsexactlyforCIephemeralrun4567890123456", } # The upgrade tier defaults its base to recipe_versions[-2]. For the 3.1.0 upgrade PR the