1

Context:
My project has around a thousand test methods.
I am executing mvn test with reuseForks=true that causes JVM processes to be reused across test classes. This works for most of my test classes, however, one class has to be executed in a separate JVM process, multithreaded.
Specifying reuseForks=false obviously causes multiple process termination and creation operations that take simply too much time.

Question:
Is it possible to execute mvn test with reuseForks=false and parallel=method on a single test class? Leaving all other classes with reuseForks=true and no parallel execution?

Sayid
  • 1,083
  • 2
  • 10
  • 21
  • Why does your code need such thing? A Unit Test ? – khmarbaise Aug 15 '16 at 12:38
  • @khmarbaise Yes. These are unit tests. Sharing processes in execution results in some test failures since configuration files are cached. I experience an issue similar to http://stackoverflow.com/questions/3365628/junit-tests-pass-in-eclipse-but-fail-in-maven-surefire – Sayid Aug 15 '16 at 13:20

1 Answers1

0

I don't think that this is possible to be configured in the pom.

As a workaround you can execute mvn test twice. First run all of the tests except the special one. Second run the special test. You can place this complexity in utility shell script.

vbuhlev
  • 509
  • 2
  • 10