4

I use pitest with Maven in Jenkins.

In my pom.xml I have

        <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <version>1.1.8</version>
            <configuration>
                <targetClasses>
                    <param>com.**********</param>
                </targetClasses>
                <targetTests>
                    <param>com.**********</param>
                </targetTests>
            </configuration>
        </plugin>

Maven command:

mvn -DwithHistory org.pitest:pitest-maven:mutationCoverage | tee mvn.log

I enabled verbose output:

mvn -DwithHistory -Dverbose org.pitest:pitest-maven:mutationCoverage | tee mvn.log

I get this error:

Failed to execute goal org.pitest:pitest-maven:1.1.8:mutationCoverage (default-cli) on project model: Execution default-cli of goal org.pitest:pitest-maven:1.1.8:mutationCoverage failed: Coverage generation minion exited abnormally!

I also have this in the Maven output:

UPDATED WITH VERBOSE LOGGING ENABLED

[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ********** - model 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- pitest-maven:1.1.8:mutationCoverage (default-cli) @ model ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Default limit mutations plugin
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from /var/lib/jenkins/sharedspace/**********/model/target/classes
[INFO] Will read and write history at /tmp/com.**********.model.1.0-SNAPSHOT_pitest_history.bin
10:38:57 AM PIT >> FINE : Running report with ReportOptions [targetClasses=[^com\.**********.*$], excludedMethods=[], excludedClasses=[], codePaths=[/var/lib/jenkins/sharedspace/**********/model/target/classes], reportDir=/var/lib/jenkins/sharedspace/**********/model/target/pit-reports, historyInputLocation=/tmp/com.**********.model.1.0-SNAPSHOT_pitest_history.bin, historyOutputLocation=/tmp/com.**********.model.1.0-SNAPSHOT_pitest_history.bin, sourceDirs=[/var/lib/jenkins/sharedspace/**********/model/src/main/java, /var/lib/jenkins/sharedspace/**********/model/src/test/java], classPathElements=[/var/lib/jenkins/sharedspace/**********/model/target/test-classes, /var/lib/jenkins/sharedspace/**********/model/target/classes, /var/lib/jenkins/.m2/repository/com/**********/core/1.0-SNAPSHOT/core-1.0-SNAPSHOT.jar, /var/lib/jenkins/.m2/repository/com/**********/basics/1.0-SNAPSHOT/basics-1.0-SNAPSHOT.jar, /var/lib/jenkins/.m2/repository/com/**********/**********/1.0-SNAPSHOT/**********-1.0-SNAPSHOT.jar, /var/lib/jenkins/.m2/repository/junit/junit/4.12/junit-4.12.jar, /var/lib/jenkins/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar, /var/lib/jenkins/.m2/repository/pl/pragmatists/JUnitParams/1.0.4/JUnitParams-1.0.4.jar, /var/lib/jenkins/.m2/repository/org/slf4j/slf4j-api/1.7.13/slf4j-api-1.7.13.jar, /var/lib/jenkins/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar, /var/lib/jenkins/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar, /var/lib/jenkins/.m2/repository/org/pitest/pitest/1.1.8/pitest-1.1.8.jar], mutators=[], dependencyAnalysisMaxDistance=-1, mutateStaticInitializers=false, jvmArgs=[], numberOfThreads=1, timeoutFactor=1.25, timeoutConstant=3000, targetTests=[^com\.**********.*$], loggingClasses=[], maxMutationsPerClass=-1, verbose=true, failWhenNoMutations=true, outputs=[HTML], groupConfig=TestGroupConfig [excludedGroups=[], includedGroups=[com.**********.test.annotations.type.UnitTest]], mutationUnitSize=0, shouldCreateTimestampedReports=true, detectInlinedCode=true, exportLineCoverage=false, mutationThreshold=0, coverageThreshold=0, mutationEngine=gregor, javaExecutable=null, includeLaunchClasspath=true]
10:38:57 AM PIT >> FINE : System class path is /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/mvn3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/mvn3.2.2/conf/logging
10:38:57 AM PIT >> FINE : Maximum available memory is 2009 mb
10:38:57 AM PIT >> FINE : MINION : Installing PIT agent

10:38:57 AM PIT >> INFO : Sending 1 test classes to minion
10:38:57 AM PIT >> INFO : Sent tests to minion
10:38:58 AM PIT >> INFO : MINION : 10:38:58 AM PIT >> INFO : Checking environment
10:38:58 AM PIT >> FINE : Expecting 1 tests classes from parent
10:38:58 AM PIT >> FINE : Tests classes received

10:38:58 AM PIT >> INFO : MINION : 10:38:58 AM PIT >> SEVERE : Error calculating coverage. Process will exit.
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:715)
    at sun.ref
10:38:58 AM PIT >> INFO : MINION : lect.annotation.AnnotationParser.parseArray(AnnotationParser.java:522)
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:348)
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:283)
    at sun.r
10:38:58 AM PIT >> INFO : MINION : eflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:117)
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
    at java.lang.Class.initAnnotationsIfNecessary(Class.java:3281)
    at java.lang.Class.getAn
10:38:58 AM PIT >> INFO : MINION : notation(Class.java:3229)
    at org.pitest.junit.JUnit4SuiteFinder.apply(JUnit4SuiteFinder.java:30)
    at org.pitest.junit.JUnit4SuiteFinder.apply(JUnit4SuiteFinder.java:26)
    at org.pitest.extension.common.CompoundTestSuiteFinder.apply(CompoundTestSuiteFinder.
10:38:58 AM PIT >> INFO : MINION : java:20)
    at org.pitest.extension.common.CompoundTestSuiteFinder.apply(CompoundTestSuiteFinder.java:9)
    at org.pitest.extension.common.CompoundTestSuiteFinder.apply(CompoundTestSuiteFinder.java:20)
    at org.pitest.extension.common.CompoundTestSuiteFinder.ap
10:38:58 AM PIT >> INFO : MINION : ply(CompoundTestSuiteFinder.java:9)
    at org.pitest.testapi.execute.FindTestUnits.findTestUnits(FindTestUnits.java:47)
    at org.pitest.testapi.execute.FindTestUnits.getTestUnits(FindTestUnits.java:40)
    at org.pitest.testapi.execute.FindTestUnits.findTestUnit
10:38:58 AM PIT >> INFO : MINION : sForAllSuppliedClasses(FindTestUnits.java:29)
    at org.pitest.coverage.execute.CoverageMinion.discoverTests(CoverageMinion.java:147)
    at org.pitest.coverage.execute.CoverageMinion.getTestsFromParent(CoverageMinion.java:128)
    at org.pitest.coverage.execute.C
10:38:58 AM PIT >> INFO : MINION : overageMinion.main(CoverageMinion.java:79)

10:38:58 AM PIT >> SEVERE : Coverage generator Minion exited abnormally due to UNKNOWN_ERROR
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s

What is going wrong that is causing the error and how can I solve it?

EDIT

I should probably look at a configuration issue on the Jenkins server, because it works when I do it locally in a Vagrant box. I just don't know where to start.

Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
  • 1
    Is the error reproducible locally? Did you have it before with earlier PIT versions? Does it occur only with incremental analysis enabled (`-DwithHistory`)? – Marcin Zajączkowski Jan 24 '16 at 11:10
  • I'll have to wait until I get back to the office to reproduce it locally. It has worked before, with the same version, with incremental analysis. I am not aware of relevant configuration changes, only changes to the analyzed code (new commits). I'll check without incremental analysis. – Amedee Van Gasse Jan 24 '16 at 11:48
  • 1
    You can enable verbose logging with `-Dverbose`. It may provide more information. – henry Jan 25 '16 at 09:19
  • @henry I updated the question with verbose logging enabled. Unfortunately not a lot more information. – Amedee Van Gasse Jan 25 '16 at 09:52
  • 1
    @AmedeeVanGasse Not seen this from pitest before but `java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy` usually means an annotation references a class that isn't on the classpath. Does the classpath in the debug look to include everything you expect? Have you introduced any new libraries/frameworks recently? – henry Jan 25 '16 at 10:05
  • @henry It's very well possible that our developers have introduced any libraries/frameworks. I also know that one of the submodules (not this one) has been moved into the core module and inter-module dependencies have been changed accordingly. And at least 2 new submodules have been introduced. Anything in particular that should catch my eye? It's a bit hard because I don't know what I should be looking for, or where. – Amedee Van Gasse Jan 25 '16 at 10:21
  • @Szpak the error can be reproduced on Jenkins if I don't use -`DwithHistory`. Next: trying to reproduce it locally. – Amedee Van Gasse Jan 25 '16 at 10:23
  • @AmedeeVanGasse I'm afraid I'm not sure what we're looking for either. I suspect that it relates to changes to the classpath and/or annotation use (but I may be wrong). I can only suggest looking to see what's changed between the last successful run and this one. – henry Jan 25 '16 at 10:28
  • @Szpak The error is not reproducible locally. I ran it locally in a Vagrant-powered Ubuntu Trusty VM with 2 GB RAM, directly with the `mvn` command. The Jenkins server has 14 GB RAM, so I'm not inclined to look into memory issues - unless Jenkins isn't configured to actually give all that memory to Maven. – Amedee Van Gasse Jan 25 '16 at 16:29
  • @AmedeeVanGasse That is bad - it would be easier to try to find a reason and/or a solution for the problem locally. I agree with Henry that it would be rather something with changes in your project dependencies than PIT itself. Unfortunately JDK doesn't say what class/annotation exactly caused a problem. – Marcin Zajączkowski Jan 25 '16 at 21:51
  • 1
    I decided to give up on pitest for now. It doesn't give me enough added value for the time I've put into it. – Amedee Van Gasse Jan 26 '16 at 10:53

0 Answers0