maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Gudian <andreas.gud...@gmail.com>
Subject Re: SureFire 2.16 doesn't respect forkCount
Date Wed, 25 Sep 2013 21:07:03 GMT
That sounds bad. reuseForks=false and forkCount=2 should spawn up to two
JVMs in parallel (a new one for each test class), and the foobar parameter
should be populated with a value of 1 or 2 and be distinct between
concurrently running JVMs. If that doesn't work, you found a bug. :)

What happens when you use reuseForks=true? Does it work for you in that
case?



2013/9/25 Laird Nelson <ljnelson@gmail.com>

> Having trouble believing what I'm seeing, especially given the excellent
> documentation at
>
> http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
> ,
> but it seems to me that specifying <forkCount>2</forkCount> and
> <reuseForks>false</reuseForks> using SureFire 2.16 simply doesn't do
> anything (it seems to behave as though I had specified nothing).
>
> The debug output shows that the default value for forkMode (which I haven't
> specified, per the documentation) is (as you would expect) 1, and the
> behavior from my tests seems to indicate that this is trumping (i.e.
> there's only one VM forked).
>
> Furthermore, including something like this:
>
> <systemPropertyVariables>
>   <foobar>${surefire.forkNumber}</foobar>
> </systemPropertyVariables>
>
> ...yields null in my tests for:
>
> System.getProperty("foobar");
>
> ...but if I change it to
>
> <systemPropertyVariables>
>   <foobar>bizbaw</foobar>
> </systemPropertyVariables>
>
> ...then System.getProperty("foobar") yields "bizbaw" as I'd expect.
>
> The net behavior makes me think that I'm missing something fundamental, or
> that the documentation has instructed me to do something that doesn't work.
>
> My JUnit dependency is 4.11 if it matters.
>
> Best,
> Laird
>
> --
> http://about.me/lairdnelson
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message