From 7f27362d425b502dddfbb774442549ef82b64586 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 18 Aug 2026 07:24:21 +0000 Subject: [PATCH] Raise script/test's per-package timeout to 180s (closes #194) `go test -timeout` is per package, so the budget has to clear the slowest single package: internal/handlers. Measured in a cache-defeated builder stage on the 48-core shared build host, 2026-08-18: 16.9s host load 5-20, GOMAXPROCS 48 45.9s / 47.3s / 49.0s three runs at deliberate host load 31-73 30.6s / 39.7s host load 5-20, GOMAXPROCS 6 / 4 67.3s / 97.5s host load 5-20, GOMAXPROCS 2 / 1 67.3s GOMAXPROCS 4 at deliberate host load 52-68 The old 30s budget was breached by every loaded run and by every GOMAXPROCS at or below 6. At GOMAXPROCS 4 it failed outright on plain 33e4fa4 with no other change ("panic: test timed out after 30s"); with 180s the same run passes at 41.262s. 180s is 1.85x the worst figure above and still bounds a hung package to a tolerable wait. No test is changed, skipped, shortened or desampled. https://git.eeqj.de/sneak/webhooker/issues/194 --- script/test | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/script/test b/script/test index ce6fb6b..28c635a 100755 --- a/script/test +++ b/script/test @@ -1,12 +1,32 @@ #!/bin/sh # script/test: run the test suite. +# +# -timeout is applied by `go test` per package, not to the run as a whole, so +# it only has to clear the slowest single package. That is internal/handlers, +# measured in a cache-defeated builder stage on the 48-core shared build host +# (2026-08-18, this tree): +# +# 16.9s host load 5-20, GOMAXPROCS 48 +# 45.9s / 47.3s / 49.0s three runs at deliberate host load 31-73 +# 30.6s / 39.7s host load 5-20, GOMAXPROCS 6 / 4 +# 67.3s / 97.5s host load 5-20, GOMAXPROCS 2 / 1 +# 67.3s GOMAXPROCS 4 at deliberate host load 52-68 +# +# The old 30s budget was breached by every loaded run and by every GOMAXPROCS +# at or below 6; at GOMAXPROCS 4 it failed outright ("panic: test timed out +# after 30s"), reproduced on 33e4fa4 with no other change. 180s is 1.85x the +# worst figure above, and still bounds a genuinely hung package to a wait a +# human will sit through. +# +# REPO_POLICIES.md still states 30s. That figure predates this suite; do not +# restore it without re-measuring internal/handlers under load. set -eu ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" main() { cd "$ROOT" - go test -v -race -timeout 30s ./... + go test -v -race -timeout 180s ./... } main "$@"