REPO_POLICIES.md mandates a 30s test timeout that is too tight to be safe #101
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
REPO_POLICIES.md:192says "Add a 30-second timeout", and the canonicalrecipe at
:212-214uses-timeout 30s. Measurement in vaultik says thatvalue is too tight, so this is a proposed amendment to the org-canonical
policy text rather than a vaultik change.
Filing here because vaultik is where the evidence was gathered.
REPO_POLICIES.mdis org-canonical and not editable by this repo, sothis needs
sneakand an upstream edit.Evidence
Measured on vaultik's suite (
go test -race, per-package timeout):internal/database~6.4sinternal/database8.1sinternal/database10.2sAgainst the 10.2s observation, a 30s timeout is 2.9x headroom. That is
not a safety margin on a loaded or throttled CI runner — it is a flake
waiting for a slow day, and the failure mode is a timeout that looks like
a real defect and sends a correct change back for rework.
Note the 10.2s figure came from a reviewer's independent cold run and is
higher than the 8.1s the implementing agent measured. The true worst
case is not well characterised, which is itself an argument for generous
headroom.
The framing that matters
A
-timeoutis a hang backstop, not a performance budget. Its job isto convert a deadlocked test into a stack dump instead of a wedged CI job.
It should therefore sit far above the slowest legitimate runtime, not
snugly above it. Nothing is gained by failing at 30s that is not gained by
failing at 120s, and the tight value costs real flakes.
One correction worth carrying upstream, since it is a plausible-sounding
claim that could justify the tight value: cold-cache compilation is not
charged against
-timeout. The flag reaches the test binary as-test.timeoutand its clock starts insidetesting.M.Run, aftercompilation and linking. Verified twice independently in vaultik — a run
with an empty
GOCACHEspent ~46s compiling and then reportedper-package durations within noise of warm. A shell
timeout 30 go test ./...does include compilation, but that is a different mechanism.The trade the policy should decide deliberately
script/testreruns verbosely on failure, so a hung package costs thetimeout twice. At 120s that is 120 + 120 = 240s, which pushes a
hang-case Docker build to roughly 6m30s — over the same policy's
5-minute build limit. So the policy currently contains two constraints
that a hang cannot satisfy simultaneously.
Options:
qualify the 5-minute build limit for the hang case.
so a hang costs the budget once.
Recommendation: option 1 or 2. The hang case is rare and already
pathological; optimising the policy so a hang fits inside the build
limit at the cost of routine flakes is the wrong direction.
Definition of done
REPO_POLICIES.mdtimeout text.:212-214updated to match, andthe interaction with the 5-minute build limit resolved rather than left
contradictory.
the new canonical value or its divergence documented.
Until then, vaultik ships
-timeout 120sas a documented, deliberatedivergence from the canonical text, recorded in
script/test's comment.