thread dump on test timeout

166 views
Skip to first unread message

iulian dragos

unread,
Sep 17, 2021, 10:29:54 AM9/17/21
to bazel-discuss
Hi everyone,

Is there a way to configure Bazel to take a thread dump (or execute another command like `jstack`) before killing the test process on timeout?

We see some Java tests running into the 1h timeout, but judging by the test output they finished successfully (test framework output shows all registered tests have passed). We suspect some runaway JVM threads, but this is not 100% reproducible. 

thanks,
iulian

iulian dragos

unread,
Oct 11, 2021, 9:10:00 AM10/11/21
to bazel-discuss
In case anyone else is looking for this answer: after looking at the source code, it looks like the default Bazel Java test runner would do what I want (dump lingering threads on timeout). However, this is not the case with the Scalatest runner. It shouldn't be too hard to do, since the Bazel process wrapper sends the TERM signal and gives a few seconds before SIGKILL-ing the test runner and we can add our own test runner.

iulian
Reply all
Reply to author
Forward
0 new messages