check / check (push) Waiting to run
Every test that starts a database hashed the bootstrap admin password with Argon2id at 64 MB, which under -race holds about 150 MB per hash, across dozens of parallel tests. The test packages that hash now lower the memory cost to 1 MB from TestMain. One test still hashes and verifies at the shipped parameters, which are unchanged. script/test also runs at most four packages and eight parallel tests at once: unbounded, a many-core host linked and ran every test binary together. Model: opus-5-5
40 lines
1.7 KiB
Bash
Executable File
40 lines
1.7 KiB
Bash
Executable File
#!/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); 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
|
|
# 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.
|
|
#
|
|
# 90s matches the org-wide backstop in REPO_POLICIES.md and is sized here
|
|
# against the figures above: the worst case under native parallelism is 49.0s,
|
|
# and the compound GOMAXPROCS-4-under-load case at 67.3s sits at 75% of it.
|
|
# The one figure above 90s is GOMAXPROCS 1, a synthetic core floor rather than
|
|
# 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.
|
|
#
|
|
# -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
|
|
# defaults (one per core) add up to several GB on a many-core host.
|
|
set -eu
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
|
|
|
main() {
|
|
cd "$ROOT"
|
|
go test -v -race -p 4 -parallel 8 -timeout 90s ./...
|
|
}
|
|
|
|
main "$@"
|