Stack dumps not produced from timed out go-tests
When a service_test wrapping a go_test times out, it kills the go test indirectly via a context cancellation on CommandContext, inhibiting the go test from dumping useful stack traces to stderr.
It would be really nice to have those stack traces available.
Off the cuff solutions:
- Override the TEST_TIMEOUT envvar set by bazel by some reduced margin so that the go test hits its own natural timeout and exits with stack traces
- kill the go test process via SIGQUIT (e.g. override the Cancel func on the exec.Command to send a different signal), which also produces stack traces
(1) would work with any test written for bazel test (i.e. those that honor TEST_TIMEOUT)
@azdagron Hi, apologies for losing track of this one. I like your first proposal; since we know how long it took the services to startup, we can quite accurately reset the wrapped test's TEST_TIMEOUT. I'll give that a shot tomorrow!
Fixed in 0c8aad1d969db3d5e8b26dd4989dc51419b0d53f, thanks!