]
Ryan Emerson updated ISPN-8554:
-------------------------------
Git Pull Request:
Automatically interrupt hung tests
----------------------------------
Key: ISPN-8554
URL:
https://issues.jboss.org/browse/ISPN-8554
Project: Infinispan
Issue Type: Task
Components: Test Suite - Core
Affects Versions: 9.2.0.Beta1
Reporter: Dan Berindei
Assignee: Dan Berindei
Fix For: 9.3.0.Final
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.