You can specify timeout in parallel execution of JUnit tests.
The surefire plugin should print this text after shutdown or forced shutdown was triggered when timeout elapsed:
The test run has finished abruptly after timeout of 2.5 seconds.
These tests were executed in prior to the shutdown operation:
Sometimes the listed classes which have been started before timeout elapsed are not printed.