From 28dd1f326ec37139292a892c8e3d6f81466ddbf9 Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Fri, 2 Oct 2026 09:28:01 +0000 Subject: [PATCH] Justify the handlers tests' start limit with a measurement (closes #225) The cost that pushed internal/handlers near its 90s package timeout, and test app starts past fx's 15s start timeout, was every start hashing the admin password at 64 MB; that went with https://git.eeqj.de/sneak/webhooker/pulls/404. Measured since under the host's real load, the package takes 8.5s and the slowest test app start 0.49s, so neither limit changes. newTestApp now says what its start limit catches and the measurement behind it, and script/test notes that its figures predate that change and gives the current ones. No test changes what it asserts. Model: opus-5-5 --- internal/handlers/handlers_test.go | 5 +++++ script/test | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index b80332f..1088419 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -181,6 +181,11 @@ func (r *recordingArchives) Renames() []archiveRename { return out } +// newTestApp returns an app whose RequireStart fails the test when +// starting takes longer than fx's default start timeout of 15s. That +// limit catches a start that hangs, not a busy host: measured with make +// test on 2026-10-02 at host load 58-69 on 48 cores, the slowest of this +// package's starts took 0.49s. func newTestApp( t *testing.T, targets ...any, diff --git a/script/test b/script/test index 9095510..5aa6d49 100755 --- a/script/test +++ b/script/test @@ -2,9 +2,10 @@ # 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); load- and host-dependent, not invariants: +# it only has to clear the slowest single package. When this budget was set +# that was internal/handlers, measured in a cache-defeated builder stage on the +# 48-core shared build host (2026-08-18); load- and host-dependent, not +# invariants: # # 16.9s host load 5-20, GOMAXPROCS 48 # 45.9s / 47.3s / 49.0s three runs at deliberate host load 31-73 @@ -23,6 +24,11 @@ # a condition CI runs under. If a CPU-limited runner ever puts a real run near # 67s, that is the datum to revisit the org figure with. # +# Those figures predate tests hashing the admin password at 1 MB instead of +# 64 MB (https://git.eeqj.de/sneak/webhooker/pulls/404). After that change, in +# a cache-defeated build at host load 44-109 (2026-10-02), internal/handlers +# took 8.5s and the slowest package was internal/database at 15.8s. +# # -p 4 -parallel 8 keep the run under 2 GB of memory: at most four test # binaries build or run at once, each with at most eight parallel tests. Under # -race every test binary and every link costs a few hundred MB, so the