Why shutting down of testing with Pax-Exam takes so long?

95 Views Asked by At

After running integration-tests with pax-exam (4.13.1), shutting down of maven-surefire-/failsafe-plugin takes about 30 seconds. No matter if tests failed or not.

I tried different configuration of pax-exam and even the number of tests does not matter. But after the tests run through, i see following log output

08:26:21.960 [main] DEBUG org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer - Shutting down the test container (Pax Runner)

08:26:23.584 [main] INFO org.ops4j.pax.exam.spi.reactors.ReactorManager - suite finished
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.651 s - in com.foo.integrationtests.BarIT
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  53.191 s
[INFO] Finished at: 2019-04-08T08:26:53+02:00
[INFO] ------------------------------------------------------------------------

I cannot understand why after shutting down the test suite, the maven-plugin takes about 30 seconds to finish. Does anyone know why?

1

There are 1 best solutions below

0
Opodeldog On

It seems there is a bug in the actual version of pax-exam

But i found a workaround for this problem. Adding following to the plugin-configuration, will reduce the timeouts of forked processes from 30 seconds to 0.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <version>${maven-failsafe-plugin.version}</version>
  <configuration>
    <forkedProcessExitTimeoutInSeconds>0</forkedProcessExitTimeoutInSeconds>
  </configuration>
</plugin>