question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TestNG 6.13.1 leads to out of memory in surefire fork

See original GitHub issue

Hi!

During my development, I found out that I was unable to build the citrus-core module after the update of TestNG to 6.13.1, due to forever running test ending up in a java.lang.OutOfMemoryError: Java heap space exception. This occurred during surefire forked test.

<plugin>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.20.1</version>
  <configuration>
    <systemProperties>
      <property>
        <name>javax.xml.parsers.SAXParserFactory</name>
        <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
      </property>
      <property>
        <name>user.language</name>
        <value>en</value>
      </property>
    </systemProperties>
    <forkMode>once</forkMode>
    <failIfNoTests>false</failIfNoTests>
    <skipTests>${skip.unit.tests}</skipTests>
    <excludes>
      <exclude>**/IT*.java</exclude>
      <exclude>**/*IT.java</exclude>
    </excludes>
    <workingDirectory>${project.build.directory}</workingDirectory>
  </configuration>
</plugin>

One should try to find the root cause, test whether newer/older TestNG versions have the same problem and report an issue to the TestNG devs as far as it is a TestNG related root cause.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
svettwercommented, Feb 24, 2018

Hi!

I investigated the issue with the newest TestNG version 6.14.2 and unfortunately the problem still exists.

Here is the detailed stack trace for further investigation.

[ERROR] There was an error in the forked process
[ERROR] Java heap space
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] Java heap space
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:673)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR]         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[ERROR]         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[ERROR]         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:955)
[ERROR]         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
[ERROR]         at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
[ERROR]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
0reactions
svettwercommented, May 23, 2018

Hi @tushar025! Glad to hear that! I’ve also created a TestNG issue. https://github.com/cbeust/testng/issues/1788 The problem is known, fixed and will be part of the next release, which is unfortunately currently not scheduled. Nevertheless, this might be interesting for you as well!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.OutOfMemoryError: Java heap space in Maven
When I run maven test, java.lang.OutOfMemoryError happens. I google it for solutions and have tried to export MAVEN_OPTS=-Xmx1024m, but it did not work....
Read more >
Jenkins Maven Surefire OOM - Ralph YY's Blog
The issue is only when we use combination jenkins + surefire maven test, the surefire output will stay in jenkins node memory!!! That's...
Read more >
Spring Framework Reference Documentation
The spring-web module provides basic web-oriented integration features such as multipart file upload functionality and the initialization of the IoC container ...
Read more >
Matthew 1-27 Good News Translation - Bible Gateway
12 His winnowing fork is in his hand, and he will clear his threshing floor ... Hetzron was the father of Ram, ......
Read more >
Release Notes - Hortonworks Data Platform
Duplicate surefire plugin config in hadoop-common. ... HDFS-8965: Harden edit log reading code against out of memory errors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found