mavenquarkusjacocojacoco-maven-plugin

Jacoco produces truncated xml and csv file


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?


Solution

  • I found a solution using this steps:

    <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.