Documentation
¶
Overview ¶
Command slowtests reads `go test -json` on its input, prints what go test prints without -json (the output of the tests that fail, the build errors, a line per package), and fails when a test fails or when a top-level test took longer than -max: tests stay fast, and a slow one is caught the day it slows down. A package that fails while none of its tests did (its test binary ended in the middle: a panic in a goroutine after its test ended, an os.Exit, a kill) gets its raw output printed, and the tests it was running named.
Linux is the reference: where the push check runs, -max fails. On CI (when CI is set), beside the other parts of go tool task test (DJINN_TEST_BESIDE, set by tools/testall: the end-to-end tests' browsers share the cores) or on another system where a process costs ten times more (a test spawning git takes 0.7 s on Linux and 7 s on the Windows runner, the same test), a test over -max is reported and fails only over twice -max (or -max-elsewhere): a test that hangs or grows tenfold is still caught there. `go tool task test-go` alone, on Linux, holds the strict limit.
go test -json ./... | go run ./tools/slowtests
A test that must stay slow goes in allowed, with why: the list stays empty unless a test has a reason.