In a multi-module maven project, I want to print the thread-dump and fail the test when a test timeout is reached. So to achieve this I have used a combination of TimedoutTestsListener and surefire listener property.
I am using Jenkins so fail-on-end
is set to true so that all non-impacted tests continue to run as mentioned here.
So, is it possible to fail the build immediately only when timeout is reached and in other failure cases fail in the end?
- JUnit - 4.12
- Maven - 3.5
- Surefire - 2.22.2
- Jave - 8