[jira] [Commented] (SUREFIRE-1264) Some tests can be lost when running in parallel with parameterized tests

2017-08-30 Thread Valentin Baranov (JIRA)

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

Valentin Baranov commented on SUREFIRE-1264:


[~tibor17], sorry can't help with this issue right now. There're lots of 
another unexpected activities.

> Some tests can be lost when running in parallel with parameterized tests
> 
>
> Key: SUREFIRE-1264
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1264
> Project: Maven Surefire
>  Issue Type: Bug
>  Components: Junit 4.7+ (parallel) support
>Affects Versions: 2.19.1
> Environment: Maven 3.3.9
> Java 1.8.0_45 (Oracle)
> System: OS X
> Reproduced on Linux too, with both OpenJDK 7 and Java 7 from Oracle.
>Reporter: Jean-Luc Derrien
>Assignee: Tibor Digana
> Fix For: 2.20.1
>
> Attachments: failure-2.21-snapshot-SUREFIRE-1264.zip, pom.xml
>
>
> Hello,
> It appears some tests can be lost when using the parallel mode with 
> parameterized tests. Here is a [small 
> project|https://github.com/jderrien/surefire-junit-tests/tree/simple-1] I've 
> used to try to reproduce the issue we have seen.
> This is not something that happens on every run, but it's quite frequent.
> With this loop, the problem should appear in less than 2 minutes, maybe on 
> the first run when (un)lucky:
> {code}
> time while true; do mvn clean test > last.log ; tail -25 last.log ; if [ 
> "$(grep -c 'Tests run: 12' last.log)" == "0" ]; then break; fi ; done
> {code}
> Normal run:
> {noformat}
> ---
>  T E S T S
> ---
> Running [p2]
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - 
> sleeptime = 1 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - 
> sleeptime = 1 => stop
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - 
> sleeptime = 2 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - 
> sleeptime = 2 => stop
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - 
> sleeptime = 5 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - 
> sleeptime = 5 => stop
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.006 sec - 
> in [p2]
> Running [p2]
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec - 
> in [p2]
> Results :
> Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
> {noformat}
> When tests have been lost (here one test lost according to the output):
> {noformat}
> ---
>  T E S T S
> ---
> Running [p2]
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - 
> sleeptime = 5 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - 
> sleeptime = 1 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - 
> sleeptime = 2 => start
> Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec - 
> in [p2]
> Running [p2]
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec - 
> in [p2]
> Results :
> Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
> {noformat}
> Note: there are 3 test classes and 18 tests on the [master 
> branch|https://github.com/jderrien/surefire-junit-tests/tree/master] and it's 
> even more frequent/easy to reproduce.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SUREFIRE-1264) Some tests can be lost when running in parallel with parameterized tests

2017-08-23 Thread Valentin Baranov (JIRA)

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

Valentin Baranov commented on SUREFIRE-1264:


[~tibor17], unfortunately, I had no time for this during past few days :(

> Some tests can be lost when running in parallel with parameterized tests
> 
>
> Key: SUREFIRE-1264
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1264
> Project: Maven Surefire
>  Issue Type: Bug
>  Components: Junit 4.7+ (parallel) support
>Affects Versions: 2.19.1
> Environment: Maven 3.3.9
> Java 1.8.0_45 (Oracle)
> System: OS X
> Reproduced on Linux too, with both OpenJDK 7 and Java 7 from Oracle.
>Reporter: Jean-Luc Derrien
>Assignee: Tibor Digana
> Fix For: 2.20.1
>
> Attachments: failure-2.21-snapshot-SUREFIRE-1264.zip, pom.xml
>
>
> Hello,
> It appears some tests can be lost when using the parallel mode with 
> parameterized tests. Here is a [small 
> project|https://github.com/jderrien/surefire-junit-tests/tree/simple-1] I've 
> used to try to reproduce the issue we have seen.
> This is not something that happens on every run, but it's quite frequent.
> With this loop, the problem should appear in less than 2 minutes, maybe on 
> the first run when (un)lucky:
> {code}
> time while true; do mvn clean test > last.log ; tail -25 last.log ; if [ 
> "$(grep -c 'Tests run: 12' last.log)" == "0" ]; then break; fi ; done
> {code}
> Normal run:
> {noformat}
> ---
>  T E S T S
> ---
> Running [p2]
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - 
> sleeptime = 1 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - 
> sleeptime = 1 => stop
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - 
> sleeptime = 2 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - 
> sleeptime = 2 => stop
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - 
> sleeptime = 5 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - 
> sleeptime = 5 => stop
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.006 sec - 
> in [p2]
> Running [p2]
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec - 
> in [p2]
> Results :
> Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
> {noformat}
> When tests have been lost (here one test lost according to the output):
> {noformat}
> ---
>  T E S T S
> ---
> Running [p2]
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - 
> sleeptime = 5 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - 
> sleeptime = 1 => start
> com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - 
> sleeptime = 2 => start
> Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec - 
> in [p2]
> Running [p2]
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec - 
> in [p2]
> Results :
> Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
> {noformat}
> Note: there are 3 test classes and 18 tests on the [master 
> branch|https://github.com/jderrien/surefire-junit-tests/tree/master] and it's 
> even more frequent/easy to reproduce.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SUREFIRE-1302) Surefire does not wait long enough for the forked VM and assumes it to be dead

2017-08-14 Thread Valentin Baranov (JIRA)

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

Valentin Baranov commented on SUREFIRE-1302:


I think the best way is to reopen 1264 because it is not completely done and 
can't be delivered right now.
I'll try to find time after work to fix it.

> Surefire does not wait long enough for the forked VM and assumes it to be dead
> --
>
> Key: SUREFIRE-1302
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1302
> Project: Maven Surefire
>  Issue Type: Request
>  Components: Maven Surefire Plugin
>Affects Versions: 2.19.1
>Reporter: Yuriy Zaplavnov
>Assignee: Tibor Digana
> Fix For: 2.20.1
>
> Attachments: 2017-05-18T05-48-08_685-jvmRun1.dumpstream, 
> surefire-gclog.log, surefire-logs, 
> surefire-tests-terminated-master-aa9330316038f6b46316ce36ff40714ffc7cf299.zip,
>  tests_log_01.txt, tests_log_02.txt
>
>
> This issue happens because surefire kills the forked container if it times 
> out waiting for the 'ping'.
> In org.apache.maven.surefire.booter.ForkedBooter class there is hardcoded 
> constant PING_TIMEOUT_IN_SECONDS  = 20 which is used in the following method:
> {code}
> private static ScheduledFuture listenToShutdownCommands( CommandReader 
> reader )
> {
> reader.addShutdownListener( createExitHandler( reader ) );
> AtomicBoolean pingDone = new AtomicBoolean( true );
> reader.addNoopListener( createPingHandler( pingDone ) );
> return JVM_TERMINATOR.scheduleAtFixedRate( createPingJob( pingDone, 
> reader ),
>0,PING_TIMEOUT_IN_SECONDS, 
> SECONDS );
> }
> {code}
> to create ScheduledFuture.
> In some of the cases the forked container might respond a bit later than it's 
> expected and surefire kills it
> {code}
> private static Runnable createPingJob( final AtomicBoolean pingDone, final 
> CommandReader reader  )
> {
> return new Runnable()
> {
> public void run()
> {
> boolean hasPing = pingDone.getAndSet( false );
> if ( !hasPing )
> {
> exit( 1, KILL, reader, true );
> }
> }
> };
> }
> {code}
> As long as we need to terminate it anyway, It would be really helpful if the 
> problem could be solved making the PING_TIMEOUT_IN_SECONDS  configurable with 
> the ability to specify the value from maven-surefire-plugin. 
> It would help to configure this timeout based on needs and factors of the 
> projects where surefire runs.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SUREFIRE-1302) Surefire does not wait long enough for the forked VM and assumes it to be dead

2017-08-14 Thread Valentin Baranov (JIRA)

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

Valentin Baranov commented on SUREFIRE-1302:


[~tibor17], the ticket you're talking about is closed.
As far as I can understand the situation is like the following:
1. There was an issue SUREFIRE-1264.
2. It was "fixed" and closed
3. After that, some kind of regression was found, but issue itself wasn't 
reopened.
Am I right? 

> Surefire does not wait long enough for the forked VM and assumes it to be dead
> --
>
> Key: SUREFIRE-1302
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1302
> Project: Maven Surefire
>  Issue Type: Request
>  Components: Maven Surefire Plugin
>Affects Versions: 2.19.1
>Reporter: Yuriy Zaplavnov
>Assignee: Tibor Digana
> Fix For: 2.20.1
>
> Attachments: 2017-05-18T05-48-08_685-jvmRun1.dumpstream, 
> surefire-gclog.log, surefire-logs, 
> surefire-tests-terminated-master-aa9330316038f6b46316ce36ff40714ffc7cf299.zip,
>  tests_log_01.txt, tests_log_02.txt
>
>
> This issue happens because surefire kills the forked container if it times 
> out waiting for the 'ping'.
> In org.apache.maven.surefire.booter.ForkedBooter class there is hardcoded 
> constant PING_TIMEOUT_IN_SECONDS  = 20 which is used in the following method:
> {code}
> private static ScheduledFuture listenToShutdownCommands( CommandReader 
> reader )
> {
> reader.addShutdownListener( createExitHandler( reader ) );
> AtomicBoolean pingDone = new AtomicBoolean( true );
> reader.addNoopListener( createPingHandler( pingDone ) );
> return JVM_TERMINATOR.scheduleAtFixedRate( createPingJob( pingDone, 
> reader ),
>0,PING_TIMEOUT_IN_SECONDS, 
> SECONDS );
> }
> {code}
> to create ScheduledFuture.
> In some of the cases the forked container might respond a bit later than it's 
> expected and surefire kills it
> {code}
> private static Runnable createPingJob( final AtomicBoolean pingDone, final 
> CommandReader reader  )
> {
> return new Runnable()
> {
> public void run()
> {
> boolean hasPing = pingDone.getAndSet( false );
> if ( !hasPing )
> {
> exit( 1, KILL, reader, true );
> }
> }
> };
> }
> {code}
> As long as we need to terminate it anyway, It would be really helpful if the 
> problem could be solved making the PING_TIMEOUT_IN_SECONDS  configurable with 
> the ability to specify the value from maven-surefire-plugin. 
> It would help to configure this timeout based on needs and factors of the 
> projects where surefire runs.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SUREFIRE-1302) Surefire does not wait long enough for the forked VM and assumes it to be dead

2017-08-14 Thread Valentin Baranov (JIRA)

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

Valentin Baranov commented on SUREFIRE-1302:


[~tibor17], when can we expect this fix to be delivered within new plugin 
version? It is very critical for us.

> Surefire does not wait long enough for the forked VM and assumes it to be dead
> --
>
> Key: SUREFIRE-1302
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1302
> Project: Maven Surefire
>  Issue Type: Request
>  Components: Maven Surefire Plugin
>Affects Versions: 2.19.1
>Reporter: Yuriy Zaplavnov
>Assignee: Tibor Digana
> Fix For: 2.20.1
>
> Attachments: 2017-05-18T05-48-08_685-jvmRun1.dumpstream, 
> surefire-gclog.log, surefire-logs, 
> surefire-tests-terminated-master-aa9330316038f6b46316ce36ff40714ffc7cf299.zip,
>  tests_log_01.txt, tests_log_02.txt
>
>
> This issue happens because surefire kills the forked container if it times 
> out waiting for the 'ping'.
> In org.apache.maven.surefire.booter.ForkedBooter class there is hardcoded 
> constant PING_TIMEOUT_IN_SECONDS  = 20 which is used in the following method:
> {code}
> private static ScheduledFuture listenToShutdownCommands( CommandReader 
> reader )
> {
> reader.addShutdownListener( createExitHandler( reader ) );
> AtomicBoolean pingDone = new AtomicBoolean( true );
> reader.addNoopListener( createPingHandler( pingDone ) );
> return JVM_TERMINATOR.scheduleAtFixedRate( createPingJob( pingDone, 
> reader ),
>0,PING_TIMEOUT_IN_SECONDS, 
> SECONDS );
> }
> {code}
> to create ScheduledFuture.
> In some of the cases the forked container might respond a bit later than it's 
> expected and surefire kills it
> {code}
> private static Runnable createPingJob( final AtomicBoolean pingDone, final 
> CommandReader reader  )
> {
> return new Runnable()
> {
> public void run()
> {
> boolean hasPing = pingDone.getAndSet( false );
> if ( !hasPing )
> {
> exit( 1, KILL, reader, true );
> }
> }
> };
> }
> {code}
> As long as we need to terminate it anyway, It would be really helpful if the 
> problem could be solved making the PING_TIMEOUT_IN_SECONDS  configurable with 
> the ability to specify the value from maven-surefire-plugin. 
> It would help to configure this timeout based on needs and factors of the 
> projects where surefire runs.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SUREFIRE-1261) surefire hangs of failed tests and keeps lock on surefirebooter on Windows preventing clean

2017-06-08 Thread Valentin Baranov (JIRA)

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

Valentin Baranov commented on SUREFIRE-1261:


[~tibor17], we have the same problem.
{code:xml}
kill
{code}
didn't help.
Could you please fix this problem or provide some temporary solution?

> surefire hangs of failed tests and keeps lock on surefirebooter on Windows 
> preventing clean
> ---
>
> Key: SUREFIRE-1261
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1261
> Project: Maven Surefire
>  Issue Type: Bug
>  Components: Maven Surefire Plugin, process forking
>Affects Versions: 2.17, 2.19.1
> Environment: Apache Maven 3.3.9 
> (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
> Maven home: C:\project\software\maven
> Java version: 1.8.0_66, vendor: Oracle Corporation
> Java home: C:\project\software\java\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"
>Reporter: Jörg Hohwiller
>Assignee: Tibor Digana
>
> I have Spring-Tests run with surefire in a plain commandline maven build on 
> windows. For whatever reason many tests fail with spring initialization 
> exception. If I cancel the build in this case ([ctrl][c]) and then restart a 
> clean build maven failes to delete the target directory. Using sysinternal 
> tools I traced down that a java.exe process is hanging that locks a JAR 
> called surefirebooter located in target. This is IMHO the forked process from 
> the maven surefire plugin that was not terminated properly when the maven 
> process was cancelled. 
> You might need to register a shutdown hook in maven-surefire that properly 
> cleans up the forked process. But this is just a brute guess...
> http://stackoverflow.com/questions/17465117/maven-surefirebooter



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] (MNG-5323) Add ability to interrupt a build with SUCCESS status from maven plugins.

2012-12-26 Thread Valentin Baranov (JIRA)

[ 
https://jira.codehaus.org/browse/MNG-5323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=316253#comment-316253
 ] 

Valentin Baranov commented on MNG-5323:
---

Hello.
What status does this ticket have?
Can we expect it to be resolved?

 Add ability to interrupt a build with SUCCESS status from maven plugins.
 

 Key: MNG-5323
 URL: https://jira.codehaus.org/browse/MNG-5323
 Project: Maven 2  3
  Issue Type: Improvement
  Components: General, Plugin API
Affects Versions: 3.1.x
 Environment: any
Reporter: Stanislav Tyurikov
Priority: Critical
 Attachments: build_succeed_exception.patch


 Add ability to successfully finish a build from maven plugin. It can help to 
 create maven plugins for build optimization. Currently we can interrupt a 
 build only to fail it (by throwing an exception from the execute method of a 
 mojo).
 This functionality can be easily implemented by adding BuildSuccessException 
 to the maven core and modifying LifecycleModuleBuilder and 
 DefaultBuildPluginManager to process this exception and finish the build as 
 succeed. Any custom maven plugin can throw BuildSuccessException to indicate 
 the build is OK and no further steps are needed to be executed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira