Fed*_*zza 7 maven-surefire-plugin gitlab docker spring-boot gitlab-ci
我们有大约10个不同的应用程序,它们是使用Groovy的Spring Boot项目.
我们所有的项目都在所有开发人员工作站中正确构建,并且它们正常运行直到昨天,但突然所有项目今天仅在我们的GitLab CI管道中停止工作且出现以下错误:
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:37 min
[INFO] Finished at: 2018-10-31T17:49:11Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project ctg-oms-component: There are test failures.
[ERROR]
[ERROR] Please refer to /builds/ctg-integrations/ctg-oms-component/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Run Code Online (Sandbox Code Playgroud)
我已经使用我们的GitLab CI管道拉出了相同的docker镜像,测试了构建项目并且一切正常.但是,该错误仅发生在GitLab CI中.
经过调查看起来像surefire正在创建一个使GitLab CI docker崩溃的分支.为了解决这个问题,我添加了以下显式配置以避免分叉VM,这消除了上述错误.
<!-- Needed only for GitLab CI -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>0</forkCount>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
你知道为什么会这样吗?有没有其他方法来修复GitLab CI以避免此问题?我不太喜欢这种解决方法,因为它只是一种避免GitLab CI爆炸的方法,但不知道如何在Gitlab的幕后处理Docker.
这些问题与最新的maven docker图像有关.
有一个开放的github问题,人们报告了同样的问题:https: //github.com/carlossg/docker-maven/issues/90
经过调查后,我可以使用alpine保存我添加maven-surefire-plugin解决方法的版本来解决问题.值得一提的是,使用surefire解决方法会带来另一个问题,例如像jacoco这样的插件因为需要VM fork而无法运行.
因此,这些图像无缝工作(不需要确定的解决方法):
但是,如果我们使用非高山版本,问题仍然存在.
| 归档时间: |
|
| 查看次数: |
1922 次 |
| 最近记录: |