go test
has some bad defaults that have eaten up my time.
Once you've added enough tests to a package, you will magically start to run into the panic: test timed out after 10m0s
error. This is because the test -timeout
option has a 10m
default and the timeout applies on a test package basis, not a per-test basis as you might expect. So when the combined execution time of all tests in the package exceeds the 10-minute limit, this error arises. Diagnosing this issue can be particularly frustrating because each test run takes at least 10 minutes to reproduce and provide feedback. Additionally, the error message makes it seem like it's a single test being the problem, but it's just that one new test that was the straw that broke the camels back and crossed the 10 minute threshold overall.
The timeout mechanism should ideally operate on a per-test basis. If a package-level timeout is still desired, it sh