Good afternoon! I use following stack for implementation automation tests: Java 8, Maven, Jenkins for automation execution of tests. From time to time (not every time, approximately 3-5% of all executions) I get problem with test(s) during their parallel execution. Parallel execution is provided by Jenkins and jenkins file. Example structure of jenkins file:
stage('First suite'){
parallel {
stage('1 test'){
}
stage('2 test'){
}
}
}
Last time I get following error:
[ERROR] java.lang.NullPointerException
[ERROR] at java.util.Properties$LineReader.readLine(Properties.java:434)
[ERROR] at java.util.Properties.load0(Properties.java:353)
[ERROR] at java.util.Properties.load(Properties.java:341)
[ERROR] at org.apache.maven.surefire.booter.SystemPropertyManager.loadProperties(SystemPropertyManager.java:50)
[ERROR] at org.apache.maven.surefire.booter.BooterDeserializer.<init>(BooterDeserializer.java:62)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.setupBooter(ForkedBooter.java:109)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:561)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project webuicheck: There are test failures.
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:748)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[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:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[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:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
I've tried to follow all recommendation concerning:
- updating of maven-surefire-plugin (now I have one of the latest version);
- setting parameters in pom.xml:
<systemPropertyVariables>
<xmlOutputDir>${project.build.directory}/surefire</xmlOutputDir>
</systemPropertyVariables>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
<useSystemClassLoader>false</useSystemClassLoader>
<useManifestOnlyJar>false</useManifestOnlyJar>
<parallel>classes</parallel>
<forkCount>10</forkCount>
<reuseForks>true</reuseForks>
<useUnlimitedThreads>true</useUnlimitedThreads>
<argLine>-Xmx1024m -Xms64m</argLine>
I'm desperate and don't know what else to do. Maybe you've faced with the same problem during parallel execution in jenkins (single test execution always complete successfully). Thank you and have a nice day!