Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.12.4
-
None
-
Windows 7 64 bits
Ubuntu 11.10 64 bits
Description
In a project we use the failsafe plugin for our ITs.
The option 'forkedProcessTimeoutInSeconds' is used to have a time limit for the test execution.
<configuration> <forkedProcessTimeoutInSeconds>3</forkedProcessTimeoutInSeconds> </configuration>
We also have goals registered in the post-integration-phase for environment clean-up.
When the tests are in timeout, the maven execution is stopped and the post-integration-test phase is not executed, leaving our environment dirty. The post-integration-test phase should be executed after timeout the same way it is executed after failed tests.
Attached is a simple project illustrating the issue:
- a JUnit test that runs forever
- a goal is registered in the post-integration phase
- the timeout is set on the project
If you run it, you will see the post-integration-phase is not executed:
[INFO] --- maven-failsafe-plugin:2.12.4:integration-test (integration-test) @ failsave.timeout.example --- [INFO] Failsafe report directory: /home/sfargier/Téléchargements/failsafe-timeout/target/failsafe-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running TestRunsForeverITCase Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.468s [INFO] Finished at: Wed Oct 31 14:20:58 CET 2012 [INFO] Final Memory: 9M/490M [INFO] ------------------------------------------------------------------------
As a side-note, if we set the forkMode option to 'always', then the post-integration-test is executed even if the timeout expires. But there are some Java processes for the tests (the one running surefire-booter-*.jar) that are not killed. There seems to be an already opened issue for that (http://jira.codehaus.org/browse/SUREFIRE-773).