[ https://issues.apache.org/jira/browse/SUREFIRE-1302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16096378#comment-16096378 ]
Hudson commented on SUREFIRE-1302: ---------------------------------- SUCCESS: Integrated in Jenkins build maven-surefire-dev #10 (See [https://builds.apache.org/job/maven-surefire-dev/10/]) SUREFIRE-1302_4 (tibor17: [http://git-wip-us.apache.org/repos/asf/?p=maven-surefire.git&a=commit&h=c7e0582bbc181b2d63901367f4d12613640352a7]) * (add) surefire-api/src/test/java/org/apache/maven/surefire/util/ReflectionUtilsTest.java * (edit) surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java * (add) surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java * (edit) maven-failsafe-plugin/pom.xml * (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java * (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java * (edit) surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java * (edit) maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java * (edit) surefire-api/src/main/java/org/apache/maven/surefire/util/ReflectionUtils.java * (edit) surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java * (edit) surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConstants.java * (edit) pom.xml * (add) surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessInfo.java * (add) surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java * (edit) surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterDeserializer.java * (edit) surefire-booter/src/test/java/org/apache/maven/surefire/booter/JUnit4SuiteTest.java * (edit) surefire-api/src/main/java/org/apache/maven/surefire/booter/CommandReader.java * (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java * (edit) maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java * (edit) surefire-api/pom.xml * (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java * (edit) surefire-api/src/test/java/org/apache/maven/JUnit4SuiteTest.java * (edit) maven-surefire-plugin/pom.xml * (edit) maven-surefire-plugin/src/site/apt/examples/shutdown.apt.vm * (delete) surefire-api/src/test/java/org/apache/maven/surefire/util/internal/SystemUtilsTest.java * (edit) surefire-booter/pom.xml * (add) surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java * (edit) maven-surefire-common/pom.xml * (edit) maven-surefire-report-plugin/pom.xml * (edit) surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java * (add) surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java * (delete) surefire-api/src/main/java/org/apache/maven/surefire/util/internal/SystemUtils.java > 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)