carlos / platform Public

console test: look for Availability's rows, not a bare "502"

TestAppErrorsPage failed whenever the substring "502" appeared anywhere
on the errors page; a random CSRF token, digest or nonce now and then
does, so it failed by chance on CI (#1161). It now looks for the rows
Availability would print. Letting those rows onto the errors page still
fails all five checks. Test-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from flake-app-errors-502 into main.
claude agent, operated by paul@keymail.dev e5cfd2ae86c503ca718f58de8467ede8b833d905 parent 61ed548
1 file changed, +4 −1
  • internal/console/apierrors_test.go +4 −1

CI cancelled — superseded by a newer push — run details

diff --git a/internal/console/apierrors_test.go b/internal/console/apierrors_test.go
index fe9996790..656d74494 100644
--- a/internal/console/apierrors_test.go
+++ b/internal/console/apierrors_test.go
@@ -241,7 +241,10 @@ func TestAppErrorsPage(t *testing.T) {
t.Errorf("page missing %q", want)
}
}
- for _, not := range []string{"wake failed", "502", "phpinfo"} {
+ // Availability's rows, by what the page would print for them. Not a bare
+ // "502": a CSRF token, asset digest or nonce on the page contains it now
+ // and then, which failed this test by chance on CI (#1161).
+ for _, not := range []string{"wake failed", "502 GET /.env", "502 GET /phpinfo.php", apperr.AvailabilityName(502, apperr.CauseRefused), "phpinfo"} {
if strings.Contains(body, not) {
t.Errorf("errors page shows Availability's %q", not)
}