Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally! (UNKNOWN_ERROR) #1235

Open
jmccormick5 opened this issue Jun 23, 2023 · 6 comments

Comments

@jmccormick5
Copy link

I have a mostly empty project that I'm currently starting that is giving me the above error. Let's start with a stack trace:

VM : OpenJDK 64-Bit Server VM Vendor : Eclipse Adoptium Version : 17.0.7+7 Uptime : 1924 Input -> 1: -Dfile.encoding=UTF-8 2 : -Duser.country=US 3 : -Duser.language=en 4 : -Duser.variant BootClassPathSupported : false

at org.pitest.util.Unchecked.translateCheckedException(Unchecked.java:20) at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:106) at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:52) at org.pitest.mutationtest.tooling.MutationCoverage.runAnalysis(MutationCoverage.java:148) at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:138) at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:129) at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:57) at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:98) at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45) Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally! (UNKNOWN_ERROR)

Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Eclipse Adoptium Version : 17.0.7+7 Uptime : 1924 Input -> 1 : -Dfile.encoding=UTF-8 2 : -Duser.country=US 3 : -Duser.language=en 4 : -Duser.variant BootClassPathSupported : false

at org.pitest.coverage.execute.DefaultCoverageGenerator.gatherCoverageData(DefaultCoverageGenerator.java:148) at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:90) ... 7 more

My build.gradle section for pitest looks like

pitest { junit5PluginVersion.set('1.2.0') targetClasses.set(['com.company.*']) threads.set(4) timeoutConstInMillis.set(60000) mutationThreshold.set(0) coverageThreshold.set(0) outputFormats.set(['XML', 'HTML']) timestampedReports.set(false) enableDefaultIncrementalAnalysis.set(true) jvmArgs.set(['-Xmx2G']) avoidCallsTo.set(['java.util.logging','org.apache.log4j','org.slf4j','org.apache.commons.logging']) excludedMethods.set(['hashCode']) useClasspathFile.set(true) }

What am I doing wrong? Are there more options I don't know about that could give me better debugging info?

@hcoles
Copy link
Owner

hcoles commented Jun 23, 2023

Enabling pitest's verbose logging will provide more details of what happened before the error occured.

You do not seem to have set a pitest version, so the gradle plugin will be using an old, default version. You are using 1.2.0 of the pitest-junit-5-plugin. This requires at least version 1.14.0 of pitest (latest version is 1.14.2).

Depending on the version of JUnit5 you are using, you may require addtional dependencies. See

https://github.com/pitest/pitest-junit5-plugin

@jmccormick5
Copy link
Author

Okay, yeah, that is the problem: I am using Pitest 1.9.0 (that's set somewhere else in the build.gradle, and it's my error in not including that information).

I get the same error when I roll back to the junit 5 version 0.15. I actually attempted the 1.2.0 version based on internal advice at my company.

@jmccormick5
Copy link
Author

I found the solution. Apparently, the highest supported pitest version at my company is currently 1.7.x. Going much later interferes with other tools they've set up, and as such using them will always produce errors. Yes, that's old. I expect that, as all open source projects have a fairly lengthy introduction process into our environment.

@hcoles
Copy link
Owner

hcoles commented Jun 23, 2023

Unless you are using 3rd party plugin for pitest, it is hard to imagine how it could interfere with other tools.

@GiuseppeMP
Copy link

Same issue here, but the change below, fixed for me:

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

to:

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

@Stephan202
Copy link

Stephan202 commented Feb 11, 2024

@GiuseppeMP the difference between those two is that the latter also pulls in junit-jupiter-engine (and junit-jupiter-params, but that's not relevant here). So likely this is the same issue as what I described in pitest/pitest-junit5-plugin#105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants