[
https://issues.apache.org/jira/browse/SUREFIRE-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17155493#comment-17155493
]
Guido Wehner commented on SUREFIRE-1817:
----------------------------------------
Hi Tibor,
sorry for not answering for 2 days, now i have an update for you.
The surefire plugin Exceptions weren't the real problem, it was like you said
the System.halt() which was executed by spring-kafka-test (EmbeddedKafka) while
shutting down the spring context.
The spring context is shut down in parallel, so there could be some problems
when thread #1 wants to read or commit a kafka snapshot or file or whatever,
and thread #2 has already deleted the whole directory. That results in loglevel
ERROR messages, and also in a System.halt().
There were some hotfixes for that, override the shutdown behaviour and so, but
a complete spring boot update from 2.1.5 -> 2.3.2 also did the trick.
We now have no more noisy kafka during our tests and they dont fail, so
surefire can pick up and do it thing (like coverage and so).
I'm sorry for not knowing better and researching more, but after 1w i was just
empty inside and couldn't think of any other way.
Could you please close the ticket?
> SurefireForkException with JaCoCo on gitlab-ci
> ----------------------------------------------
>
> Key: SUREFIRE-1817
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1817
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Affects Versions: 2.22.2, 3.0.0-M4, 3.0.0-M5
> Environment: gitlab-ci, docker, openjdk
> Reporter: Guido Wehner
> Priority: Major
>
> Hello,
>
> we are testing our kotlin projects on gitlab-ci and we get errors while
> testing, here the stack trace:
>
> {code:java}
> Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test)
> on project <our project>: There are test failures.Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test)
> on project <our project>: There are test failures. [ERROR] [ERROR] Please
> refer to /builds/mobile-development/<our project>/target/surefire-reports for
> the individual test results. [ERROR] Please refer to dump files (if any
> exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR]
> Error occurred in starting fork, check output in log [ERROR]
> org.apache.maven.surefire.booter.SurefireBooterForkException: Error occurred
> in starting fork, check output in log [ERROR] at
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:662)
> [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:956) [ERROR]
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) [ERROR] at
> org.apache.maven.cli.MavenCli.main(MavenCli.java:192) [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)
> [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.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
> [ERROR] at
> org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
> [ERROR] at
> org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:55)
> [ERROR] -> [Help 1]
> {code}
> We are using the JaCoCo Version 0.8.5, configured like this:
> {code:xml}
> <plugin>
> <groupId>org.jacoco</groupId>
> <artifactId>jacoco-maven-plugin</artifactId>
> <version>0.8.5</version>
> <executions>
> <execution>
> <id>default-prepare-agent</id>
> <goals>
> <goal>prepare-agent</goal>
> </goals>
> </execution>
> <execution>
> <id>default-report</id>
> <phase>post-integration-test</phase>
> <goals>
> <goal>report</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> {code}
> and surefire plugin, configured like this:
> {code:xml}
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>3.0.0-M5</version>
> </plugin>
> {code}
> We don't use the maven-failsafe-plugin.
> To avoid that error we have upgraded our base image for gitlab-ci, so that
> the java version is new.
> {code:bash}
> openjdk version "1.8.0_252"
> OpenJDK Runtime Environment (build 1.8.0_252-b09)
> OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
> {code}
> Still we get failing test jobs, due to that SurefireBooterForkException.
> We did a couple of tests with the job and it fails at around 10% (2 out of 20
> runs where bad).
> It also maybe affect other 3.0.0-M versions, but at the time i was building
> it, M4 and M5 were the newest, also I read that in M4 it should be fixed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)