[ https://issues.apache.org/jira/browse/SUREFIRE-2114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kamalpreet updated SUREFIRE-2114: --------------------------------- Attachment: surefire.log > Surefire is going to kill self fork JVM. The exit has elapsed 30 seconds > after System.exit(0). > ----------------------------------------------------------------------------------------------- > > Key: SUREFIRE-2114 > URL: https://issues.apache.org/jira/browse/SUREFIRE-2114 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin > Reporter: Kamalpreet > Priority: Critical > Labels: Issue, process > Attachments: surefire.log > > > Hi Team, > I'm using maven surefire plugin (Latest Version) to execute tests on two > testing frameworks (e.g, jUnit, jBehave). > Have tried to implement parallelisation by spawning couple of Threads which > in turn create processes to execute surefire jar, taking it from - > {code:java} > ManagementFactory.getRuntimeMXBean().getSystemProperties().get("sun.java.command");{code} > Code snippet to show process creation - *CustomRunner.java* > {code:java} > void run() { > ProcessBuilder processBuilder = new ProcessBuilder(commandArray); > Map<String, String> environment = processBuilder.environment(); > environment.put("platformIndex", String.valueOf(platformIndex)); > try { > processBuilder.inheritIO(); > Process p = processBuilder.start(); > LOGGER.info("Is Alive {} {}", p.isAlive(), LocalTime.now()); > int statusCode = p.waitFor(); > } catch (Exception e) { > e.printStackTrace(); > } > }{code} > *EntryPoint.java* > {code:java} > for (int i = 0; i < 3; i++) { > Thread thread = new Thread(new CustomRunner(commandArray, > String.valueOf(i))); > thread.start(); > threadList.add(thread); > } > threadList.forEach(thread -> { > try { > thread.join(); > } catch (InterruptedException e) { > throw new RuntimeException(e); > } > }); > > System.exit(exitcode);{code} > After running two or sometimes three processes in corresponding Threads, the > process execution got stuck on p.waitFor(); > Then the process exits after 30 secs and with error message "Surefire is > going to kill self fork JVM. The exit has elapsed 30 seconds after > System.exit(0)." resulting in Build Failure (sometimes it doesn't) though the > tests have passed in their respective processes. > Seems like surefire execution is stuck in some processes. Could you please > let me know what can be the possible reasons for it and how to mitigate this? > Tried extending the ForkedProcessTimeoutInSeconds to few minutes but no luck. > Any help is much appreciated. -- This message was sent by Atlassian Jira (v8.20.10#820010)