TNG / ArchUnit

A Java architecture test library, to specify and assert architecture rules in plain Java
http://archunit.org
Apache License 2.0
3.2k stars 290 forks source link

Error when executing ArchUnit in multithreaded maven compile #1125

Open royteeuwen opened 1 year ago

royteeuwen commented 1 year ago

I already had it a few times now at random moments that ArchUnit fails when doing a mvn clean install -T2C

Any clue on what can be causing this?

The output is the following:

[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /home/jenkins/agent/workspace/ilds_cloud_develop/core && /usr/local/openjdk-11/bin/java -javaagent:/home/jenkins/.m2/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar=destfile=/home/jenkins/agent/workspace/ilds_cloud_develop/core/target/jacoco.exec org.apache.maven.surefire.booter.ForkedBooter /home/jenkins/agent/workspace/ilds_cloud_develop/core/target/surefire 2023-06-20T11-18-00_057-jvmRun1 surefire13465521230747692618tmp surefire_0200766767351337582tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 137
[ERROR] Crashed tests:
[ERROR] org.project.architecture.rules.General
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /home/jenkins/agent/workspace/ilds_cloud_develop/core && /usr/local/openjdk-11/bin/java -javaagent:/home/jenkins/.m2/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar=destfile=/home/jenkins/agent/workspace/ilds_develop/core/target/jacoco.exec org.apache.maven.surefire.booter.ForkedBooter /home/jenkins/agent/workspace/ilds_develop/core/target/surefire 2023-06-20T11-18-00_057-jvmRun1 surefire13465521230747692618tmp surefire_0200766767351337582tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 137
[ERROR] Crashed tests:
[ERROR] org.project.aem.architecture.rules.General
[ERROR]     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR]     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR]     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR]     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR]     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR]     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[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.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:190)
[ERROR]     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:186)
[ERROR]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[ERROR]     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[ERROR]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[ERROR]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[ERROR]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:834)
hankem commented 1 year ago

Exit code 137 often means OutOfMemoryError. Can you monitor the available resources during the multithreaded Maven build?