Details
-
Task
-
Resolution: Done
-
Major
-
9.2.0.Beta1
-
None
Description
Tests should always use timed wait, e.g. future.get(10, SECONDS) instead of future.get(). However, it's really easy to use the wrong method, and if a deadlock happens the test suite will never finish.
Jenkins builds do have a timeout, but the timeout kill procedure is not at all investigation-friendly: only the console output survives, the logs and test results don't.
We can add a listener (IHookable in TestNG, because regular listeners are not always invoked on the same thread as the test method) to detect when a test has been running for too long and interrupt the test thread. We can even save a thread dump to make the investigation easier.