You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-dev@maven.apache.org by Brett Porter <br...@apache.org> on 2008/01/14 06:51:39 UTC

Re: svn commit: r596894 - /maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Hi Dan,

I'm just flipping back through the commits by way of a quick review  
and had a question about this one.

Does TestNG set a default thread count once parallel is enabled?

I assume the problematic configuration is parallel = false + any  
thread count, so maybe a better alternative is to set the default, and  
manually unset it if parallel is false?

Cheers,
Brett

On 21/11/2007, at 8:58 AM, dfabulich@apache.org wrote:

> Author: dfabulich
> Date: Tue Nov 20 16:58:42 2007
> New Revision: 596894
>
> URL: http://svn.apache.org/viewvc?rev=596894&view=rev
> Log:
> [SUREFIRE-361] Don't set threadcount or parallel by default; these  
> defaults confuse TestNG 5.7
>
> Modified:
>    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/ 
> apache/maven/plugin/surefire/SurefirePlugin.java
>
> Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/ 
> org/apache/maven/plugin/surefire/SurefirePlugin.java
> URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=596894&r1=596893&r2=596894&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/ 
> apache/maven/plugin/surefire/SurefirePlugin.java (original)
> +++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/ 
> apache/maven/plugin/surefire/SurefirePlugin.java Tue Nov 20 16:58:42  
> 2007
> @@ -328,7 +328,7 @@
>      * (TestNG only) The attribute thread-count allows you to  
> specify how many threads should be allocated for this execution. Only
>      * makes sense to use in conjunction with parallel.
>      *
> -     * @parameter expression="${threadCount}" default-value="5"
> +     * @parameter expression="${threadCount}"
>      */
>     private int threadCount;
>
> @@ -337,7 +337,7 @@
>      * methods that depend on each other, which will be run in the  
> same thread in order to respect their order of
>      * execution.
>      *
> -     * @parameter expression="${parallel}" default-value="false"
> +     * @parameter expression="${parallel}"
>      * @todo test how this works with forking, and console/file  
> output parallelism
>      */
>     private String parallel;
>
>


Re: svn commit: r596894 - /maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Posted by Dan Fabulich <da...@fabulich.com>.
Brett Porter wrote:

> Hi Dan,
>
> I'm just flipping back through the commits by way of a quick review and had a 
> question about this one.
>
> Does TestNG set a default thread count once parallel is enabled?
>
> I assume the problematic configuration is parallel = false + any thread 
> count, so maybe a better alternative is to set the default, and manually 
> unset it if parallel is false?

"-parallel" doesn't mean what you think it means... in fact, this value 
was confusing TestNG because it's not a boolean (any more).

Since 5.5(?) it would be better to call it "-parallelmode"; its values can 
be either "methods" or "tests" or it can be undefined.  It has no effect 
whatsoever if -threadcount isn't set.  Furthermore, -threadcount has no 
effect unless -parallel is set to something.

Does this make sense?  No, not really.  But I also don't think it would be 
a good idea for Surefire to get into the business of managing this.  In 
2.4 we just pass the string along to TestNG and hope for the best.

-Dan