Re: Maven Surefire Forked Test Execution in a multimodule project

2020-04-10 Thread Tibor Digana
Enrico is right.

Surefire does NOT execute 3 Maven modules in parallel.
Opposite!
One module executes Surefire which divides the test into 3 additional
JVMs and the Surefire (module) is waiting for their completion.

On Thu, Apr 9, 2020 at 1:09 PM Debraj Manna  wrote:
>
> Hi
>
> I am reading the maven surefire documentation
> 
> about
> the forked test execution. It states
>
> *The default setting is forkCount=1/reuseForks=true, which means that
> maven-surefire-plugin creates one new JVM process to execute all tests in
> one Maven module.*
>
> *forkCount=1/reuseForks=false executes each test class in its own JVM
> process, one after another. It creates the highest level of separation for
> the test execution, but it would probably also give you the longest
> execution time of all the available options. Consider it as a last reso*rt.
>
>
> Can someone resolve my below doubts about the above para:
>
> In a maven multimodule project if I am setting forkcount=3 /
> reuseForks=true. Then does that mean maven-surefire-plugin will create 3
> new JVM processes and then execute tests from 3 modules in 3 JVM and all
> tests from a module will be running in the same JVM?



-- 
Cheers
Tibor

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Surefire Forked Test Execution in a multimodule project

2020-04-09 Thread Debraj Manna
Thanks Enrico.

On Thu, Apr 9, 2020 at 4:46 PM Enrico Olivelli  wrote:

> Manna
>
> Il Gio 9 Apr 2020, 13:09 Debraj Manna  ha
> scritto:
>
> > Hi
> >
> > I am reading the maven surefire documentation
> > <
> >
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
> > >
> > about
> > the forked test execution. It states
> >
> > *The default setting is forkCount=1/reuseForks=true, which means that
> > maven-surefire-plugin creates one new JVM process to execute all tests in
> > one Maven module.*
> >
> > *forkCount=1/reuseForks=false executes each test class in its own JVM
> > process, one after another. It creates the highest level of separation
> for
> > the test execution, but it would probably also give you the longest
> > execution time of all the available options. Consider it as a last
> reso*rt.
> >
> >
> > Can someone resolve my below doubts about the above para:
> >
> > In a maven multimodule project if I am setting forkcount=3 /
> > reuseForks=true. Then does that mean maven-surefire-plugin will create 3
> > new JVM processes and then execute tests from 3 modules in 3 JVM and all
> > tests from a module will be running in the same JVM?
> >
>
> No.
> If you want to run parallel execution of modules you have to use -T option
> This is independent from surefire
>
> Enrico
>


Re: Maven Surefire Forked Test Execution in a multimodule project

2020-04-09 Thread Enrico Olivelli
Manna

Il Gio 9 Apr 2020, 13:09 Debraj Manna  ha scritto:

> Hi
>
> I am reading the maven surefire documentation
> <
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
> >
> about
> the forked test execution. It states
>
> *The default setting is forkCount=1/reuseForks=true, which means that
> maven-surefire-plugin creates one new JVM process to execute all tests in
> one Maven module.*
>
> *forkCount=1/reuseForks=false executes each test class in its own JVM
> process, one after another. It creates the highest level of separation for
> the test execution, but it would probably also give you the longest
> execution time of all the available options. Consider it as a last reso*rt.
>
>
> Can someone resolve my below doubts about the above para:
>
> In a maven multimodule project if I am setting forkcount=3 /
> reuseForks=true. Then does that mean maven-surefire-plugin will create 3
> new JVM processes and then execute tests from 3 modules in 3 JVM and all
> tests from a module will be running in the same JVM?
>

No.
If you want to run parallel execution of modules you have to use -T option
This is independent from surefire

Enrico


Maven Surefire Forked Test Execution in a multimodule project

2020-04-09 Thread Debraj Manna
Hi

I am reading the maven surefire documentation

about
the forked test execution. It states

*The default setting is forkCount=1/reuseForks=true, which means that
maven-surefire-plugin creates one new JVM process to execute all tests in
one Maven module.*

*forkCount=1/reuseForks=false executes each test class in its own JVM
process, one after another. It creates the highest level of separation for
the test execution, but it would probably also give you the longest
execution time of all the available options. Consider it as a last reso*rt.


Can someone resolve my below doubts about the above para:

In a maven multimodule project if I am setting forkcount=3 /
reuseForks=true. Then does that mean maven-surefire-plugin will create 3
new JVM processes and then execute tests from 3 modules in 3 JVM and all
tests from a module will be running in the same JVM?