0

We are using the Jacoco maven plugin to generate the code coverage for some Quarkus project. It has worked fine so far, but recently we have had some occurrences of an intermittent issue on some of the builds for the same project.

In particular, all the tests pass, but the jacoco.xml and the jacoco.csv files are truncated. Meaning that the xml file ends at a certain point without proper closing, and the csv also.

The build is "long" enough (~15 minutes, ~300 tests), for what is worth, but the files are normally not that big, for example the truncated jacoco.xml file is 205 Kb roughly.

This is the Jacoco configuration:

       <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.11</version>
          <executions>
            <execution>
              <id>default-prepare-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <exclClassLoaders>*QuarkusClassLoader</exclClassLoaders>
                <destFile>just-a-location\target/jacoco-quarkus.exec</destFile>
                <append>true</append>
              </configuration>
            </execution>
          </executions>
        </plugin>

I have checked the recent modifications, but the pom was not touched, and only 2 tests were added, with nothing particular in them.

I have tried changing append with false, and adding dumpOnExit=true, but nothing changed. Any idea?

1
  • Run maven with the debug parameters and check the logs (they will be big). mvn ..... -e -X also, side note: this ~15 minutes is a lot of time for ~300 tests (not sure what your tests do but it looks odd at very least). Commented Jul 28 at 15:49

1 Answer 1

0

I found a solution using this steps:

  • upgraded failsage and surefire to the latest versions 3.5.3
  • I found an error logged by surefire: [ERROR] Surefire is going to kill self fork JVM. The exit has elapsed 30 seconds after System.exit(0).
  • Then, I looked into the dump files created by surefire in target/surefire, and I found multiple threads blocked, including jacoco ones
  • I increased the memory allocated to surefire:
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>3.5.3</version>
   <configuration>
      <argLine>-Xmx8192m -Xms2048m</argLine>
   </configuration>
</plugin>

and it started to work again.

Sign up to request clarification or add additional context in comments.

2 Comments

8 GiB heap size? Wow that's a lot...
True, I do not know who to blame: quarkus, camel, both?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.