maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Raumberger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SUREFIRE-1301) baseDir system-property gets overridden by other builder threads if forking is disabled
Date Sun, 13 Nov 2016 09:19:58 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15661176#comment-15661176
] 

Richard Raumberger commented on SUREFIRE-1301:
----------------------------------------------

[~tibor17]
Yeah, I tried that. 
Lead to the same result.

Though I noticed something different...
When running {{mvn clean test -T 3}} via CLI, the tests run and the described situation occurs.
When I run the same command with IntelliJ's bundled Maven it fails with {{parallel maven execution
is not compatible with surefire forkCount 0}}, which actually prevents this situation from
occurring.

It seems like this is connected to the used maven version.
Standalone-installation: Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
IntelliJ-Bundled: Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19
14:51:28+0100)

It seems like [this condition|https://github.com/apache/maven-surefire/blob/fb9b699e27dae905393a5bc4d5c6ae39606c3172/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L2391]
is not working properly with 3.3.9.

> baseDir system-property gets overridden by other builder threads if forking is disabled
> ---------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1301
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1301
>             Project: Maven Surefire
>          Issue Type: Documentation
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.19.1
>            Reporter: Richard Raumberger
>            Priority: Minor
>
> When running tests in a multi-module project with multiple builder threads and surefire's
forkCount set to 0, the threads override each other when setting the baseDir system-property.
> Running the [sample project|https://cloud.almost-a-blog.net/s/IHS63tBqowjhvBh/download]
results in the below output with the given commands.
> (Note: First number is the expected path. e.g. 11 => wrapper1; module1)
> *Correct*
> {code}
> mvn clean install | grep basedir
> 01 basedir=<path>/maven-surefire-example/module1
> 02 basedir=<path>/maven-surefire-example/module2
> 03 basedir=<path>/maven-surefire-example/module3
> 11 basedir=<path>/maven-surefire-example/wrapper1/module1
> 12 basedir=<path>/maven-surefire-example/wrapper1/module2
> 13 basedir=<path>/maven-surefire-example/wrapper1/module3
> 21 basedir=<path>/maven-surefire-example/wrapper2/module1
> 22 basedir=<path>/maven-surefire-example/wrapper2/module2
> 23 basedir=<path>/maven-surefire-example/wrapper2/module3
> 31 basedir=<path>/maven-surefire-example/wrapper3/module1
> 32 basedir=<path>/maven-surefire-example/wrapper3/module2
> 33 basedir=<path>/maven-surefire-example/wrapper3/module3
> {code}
> *Incorrect*
> {code}
> mvn clean install -T 3 | grep basedir
> 02 basedir=<path>/maven-surefire-example/module2
> 01 basedir=<path>/maven-surefire-example/module2
> 03 basedir=<path>/maven-surefire-example/module2
> 13 basedir=<path>/maven-surefire-example/wrapper1/module1
> 23 basedir=<path>/maven-surefire-example/wrapper1/module1
> 11 basedir=<path>/maven-surefire-example/wrapper1/module1
> 12 basedir=<path>/maven-surefire-example/wrapper2/module2
> 21 basedir=<path>/maven-surefire-example/wrapper2/module2
> 22 basedir=<path>/maven-surefire-example/wrapper2/module2
> 32 basedir=<path>/maven-surefire-example/wrapper3/module3
> 31 basedir=<path>/maven-surefire-example/wrapper3/module3
> 33 basedir=<path>/maven-surefire-example/wrapper3/module3
> {code}
> This is correct behaviour from a technical point of view as the system-properties are
shared between the threads and the surefire-executions (due to the disabled forking), therefore
I opened this issue mainly for documentation purpose.
> This behaviour does not affect our current project anymore due to the removal of the
forkCount setting, yet I think that this behaviour should be documented.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message