【发布时间】:2019-04-05 04:33:30
【问题描述】:
我们有大约 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?
我已经提取了使用我们的 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>
你知道为什么会这样吗?是否有另一种方法来修复 GitLab CI 以避免此问题?我不太喜欢这种解决方法,因为它只是一种避免 GitLab CI 爆炸的方法,但不知道 Gitlab 在幕后如何处理 Docker。
【问题讨论】:
标签: docker spring-boot gitlab gitlab-ci maven-surefire-plugin