If a test runs longer than t, panic.
The default is 10 minutes (10m).
"A test" is ambiguous in this context. I took it to mean "A single test", that is, "Each test has a timeout of t". Test runners in other languages usually default to this behavior for tests. However, the flag output indicates the timeout covers the entire test run, not individual tests.
timeout = flag.Duration("test.timeout", 0, "fail test binary execution after duration `d` (0 means unlimited)")
This also tripped up at least one person recently in the #golang-newbies Slack channel. It would be good if the output was clear that the timeout covers the entire test run, not individual tests.
The text was updated successfully, but these errors were encountered:
Which you can then run with go test -timeout=5s, which will indeed fail. OK this made me understand that clearly the timeout is not applied on an individual test level. But it still didn't define if it's applied on the entire test run, or on a package level. So I did some testing myself, inspired by my colleague, using the following setup: