So I tweaked ForkedLauncher from maven-verifier to dump out the forked command
to log.txt and at least one of the failing ITs has a duplicated system property
on the command-line:
mvn -e --batch-mode
-Dmaven.repo.local=/tmp/maven-surefire/surefire-integration-tests/../surefire-setup-integration-tests/target/it-repo
org.apache.maven.plugins:maven-clean-plugin:clean
-Dsurefire.version=2.19.2-SNAPSHOT -DtestNgVersion=5.7 -DtestNgClassifier=jdk15
-DforkMode=perthread -DreuseForks=false -DreuseForks=true -DthreadCount=1
-DtestProperty=testValue_${surefire.threadNumber}_${surefire.forkNumber}
org.apache.maven.plugins.surefire:maven-dump-pid-plugin:dump-pid test
specifically:
-DreuseForks=false -DreuseForks=true
Looking at SurefireLauncher.java
https://github.com/apache/maven-surefire/blob/master/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
1. the reuseForks method adds a new system property argument each time it’s
called: -DreuseForks=<setting>
2. the forkPerThread method calls forkMode( "perthread" ).reuseForks( false )
3. the forkOncePerThread calls forkPerThread().reuseForks( true )
So any test using SurefireLauncher’s “forkOncePerThread” method will end up
with two “reuseForks” system property options on the command-line - and will
therefore be affected by the change in system property option precedence.
This explains why ForkModeIT fails for me locally with master, but passes with
3.3.9 - with current master the -DreuseForks=false option wins, whereas with
3.3.9 the -DreuseForks=true options wins.
If I change SurefireLauncher.forkOncePerThread to avoid duplicating this system
property, ie:
return forkMode( "perthread" ).reuseForks( true );
then ForkModeIT passes with both current master and previous Maven releases.
Hope that helps...
--
Cheers, Stuart
On Monday, 13 February 2017 at 01:32, Stuart McCulloch wrote:
> Ironically I got those results the wrong way round when cutting+pasting :)
>
> To clarify, when testing
>
> mvn -Dmaven.repo.local=/tmp/aaa -Dmaven.repo.local=/tmp/zzz validate
>
> with previous Maven releases the last option wins:
>
> -Dmaven.repo.local=/tmp/zzz
>
> whereas with current master the first option wins:
>
> -Dmaven.repo.local=/tmp/aaa
>
> On Monday, 13 February 2017 at 00:19, Stuart McCulloch wrote:
>
> > Using the following command on a small test project:
> >
> > mvn -Dmaven.repo.local=/tmp/aaa -Dmaven.repo.local=/tmp/zzz validate
> >
> > and checking whether the “aaa” or “zzz” directory is created gives these
> > results for previous Maven releases:
> >
> > 2.0.11 aaa
> > 2.2.1 aaa
> > 3.0.5 aaa
> > 3.1.1 aaa
> > 3.2.5 aaa
> > 3.3.9 aaa
> >
> > whereas current master gives a different result:
> >
> > master zzz
> >
> > which confirms the precedence of CLI arguments is currently reversed on
> > master compared to previous releases
> >
> > --
> > Cheers, Stuart
> >
> >
> > On Sunday, 12 February 2017 at 23:53, Stuart McCulloch wrote:
> >
> > > git bisect is pointing to the following commit:
> > >
> > > https://github.com/apache/maven/commit/ca4303031357a7decaee8de770b71fb2c2fedd28
> > >
> > > if I revert this change then the wrong PID issue disappears and
> > > ForkModeIT passes again
> > >
> > > I suspect that reversing the whole array of system property definitions,
> > > while solving MNG-6078, is breaking precedence of arguments on the CLI
> > > (which then affects these tests)
> > >
> > > On Sunday, 12 February 2017 at 20:26, Tibor Digana wrote:
> > >
> > > > So this is a local build status of surefire running on the top of
> > > > certain
> > > > Maven Version.
> > > > Maven 3.3.9 OK on my side
> > > > Maven 3.5.0-SNAPSHOT failed. Wrong PIDs, other tests failed on freebsd
> > > > and
> > > > not on Win7, so I asked Michael for logs which I do not have.
> > > > So I am going to investigate.
> > > >
> > > > On Sun, Feb 12, 2017 at 9:05 PM, stephenconnolly [via Maven] <
> > > > [email protected]
> > > > (mailto:[email protected])> wrote:
> > > >
> > > > > Can you pop on HipChat with infra?
> > > > >
> > > > > You may need them to grab the files from the agent for you (or modify
> > > > > the
> > > > > Jenkinsfile temporarily to archive the bits you need)
> > > > >
> > > > > On Sun 12 Feb 2017 at 19:55, Tibor Digana <[hidden email]
> > > > > <http:///user/SendEmail.jtp?type=node&node=5898384&i=0>> wrote:
> > > > >
> > > > > > There is build process for surefire
> > > > > >
> > > > > > https://builds.apache.org/view/Maven/job/maven-master-
> > > > > release-status-test-surefire-linux
> > > > > > with Jenkins file.
> > > > > > This particular build fails with test
> > > > > >
> > > > > > Surefire141PluggableProvidersIT
> > > > > >
> > > > > > It is only one and different from your local build result.
> > > > > >
> > > > > > I asked Stephen to enable Workspace, because I need to have files
> > > > > > from
> > > > > > target folders for analysis to understand what is going on the
> > > > > > machine.
> > > > > > Stephen told me that I should trigger rebuild. So I did and launched
> > > > > >
> > > > >
> > > > > "Build
> > > > > > with Parameters" but the build failed not running Maven build,
> > > > > > however
> > > > > > Workspace appears now.
> > > > > >
> > > > > > How can I force trigger the build?
> > > > > >
> > > > > >
> > > > > > https://builds.apache.org/view/Maven/job/maven-master-
> > > > > release-status-test-surefire-linux/11/console
> > > > > >
> > > > > > There is another build process, old one actually, and it is
> > > > > > successful.
> > > > > > The difference is because I think race condition when JVM error once
> > > > > >
> > > > >
> > > > > goes
> > > > > > to std/err and other log in the first build with Jenkins file.
> > > > > > This can, I think, be only one more assertion statement in IT but I
> > > > > > need
> > > > > >
> > > > >
> > > > > to
> > > > > > see Workspace.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Sun, Feb 12, 2017 at 5:04 PM, Christian Schulte [via Maven] <
> > > > > > [hidden email]
> > > > > > <http:///user/SendEmail.jtp?type=node&node=5898384&i=1>>
> > > > > >
> > > > >
> > > > > wrote:
> > > > > >
> > > > > > > @Stephen: Are there any Jenkins jobs left running the plugin ITs
> > > > > > > with
> > > > > > > current Maven master? Surefire has it's own git repository. Do we
> > > > > > > have
> > > > > > > some Jenkins job for this as well? It's important to run all
> > > > > > > those ITs
> > > > > > > (plugins from subversion and the ones with theire own repository)
> > > > > > > with
> > > > > > > what we are going to release as 3.5.0 before releasing it.
> > > > > > >
> > > > > > > Regards,
> > > > > > > --
> > > > > > > Christian
> > > > > > >
> > > > > > >
> > > > > > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: [hidden email]
> > > > > > > <http:///user/SendEmail.jtp?type=node&node=5898337&i=0>
> > > > > > > For additional commands, e-mail: [hidden email]
> > > > > > > <http:///user/SendEmail.jtp?type=node&node=5898337&i=1>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ------------------------------
> > > > > > > If you reply to this email, your message will be added to the
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > > discussion
> > > > > > > below:
> > > > > > > http://maven.40175.n5.nabble.com/I-think-we-are-ready-for-
> > > > > > >
> > > > > >
> > > > >
> > > > > 3-5-0-alpha-1-
> > > > > > > tp5897626p5898337.html
> > > > > > > To start a new topic under Maven Developers, email
> > > > > > > [hidden email]
> > > > > > > <http:///user/SendEmail.jtp?type=node&node=5898384&i=2>
> > > > > > > To unsubscribe from Maven Developers, click here
> > > > > > > <
> > > > > > >
> > > > > > > .
> > > > > > > NAML
> > > > > > > <
> > > > > > >
> > > > > >
> > > > > > http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?
> > > > > >
> > > > >
> > > > > macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> > > > > base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> > > > > web.template.NabbleNamespace-nabble.view.web.template
> > > > > (http://web.template.NabbleNamespace-nabble.view.web.template).
> > > > > NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> > > > > 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> > > > > instant_email%21nabble%3Aemail.naml
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > > http://maven.40175.n5.nabble.com/I-think-we-are-ready-for-3-5-0-alpha-1-
> > > > > >
> > > > >
> > > > > tp5897626p5898378.html
> > > > > > Sent from the Maven Developers mailing list archive at Nabble.com
> > > > > > (http://Nabble.com).
> > > > >
> > > > >
> > > > > --
> > > > > Sent from my phone
> > > > >
> > > > >
> > > > > ------------------------------
> > > > > If you reply to this email, your message will be added to the
> > > > > discussion
> > > > > below:
> > > > > http://maven.40175.n5.nabble.com/I-think-we-are-ready-for-3-5-0-alpha-1-
> > > > > tp5897626p5898384.html
> > > > > To start a new topic under Maven Developers, email
> > > > > [email protected]
> > > > > (mailto:[email protected])
> > > > > To unsubscribe from Maven Developers, click here
> > > > > <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=142166&code=dGlib3JkaWdhbmFAYXBhY2hlLm9yZ3wxNDIxNjZ8LTI4OTQ5MjEwMg==>
> > > > > .
> > > > > NAML
> > > > > <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > > http://maven.40175.n5.nabble.com/I-think-we-are-ready-for-3-5-0-alpha-1-tp5897626p5898389.html
> > > > Sent from the Maven Developers mailing list archive at Nabble.com
> > > > (http://Nabble.com).
> > > >
> > > >
> > > >
> > >
> > >
> >
>