Open michielgkalkman opened 5 years ago
Hi, I am running into same error, Any pointers
Nope. No pointers.
I upgraded to pitest 5.1.2 (https://github.com/michielgkalkman/PmdPlus/tree/pitest%23537) but this results also in "Coverage generation minion exited abnormally!":
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.5.2:mutationCoverage (default-cli) on project PmdPlus: Execution default-cli of goal org.pitest:pitest-maven:1.5.2:mutationCoverage failed: Coverage generation minion exited abnormally! [ERROR] [ERROR] Please copy and paste the information and the complete stacktrace below when reporting an issue [ERROR] VM : OpenJDK 64-Bit Server VM [ERROR] Vendor : Amazon.com Inc. [ERROR] Version : 11.0.7+10-LTS [ERROR] Uptime : 16231 [ERROR] Input -> [ERROR] 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf [ERROR] 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. [ERROR] 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native [ERROR] 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus [ERROR] BootClassPathSupported : false [ERROR] [ERROR] [ERROR] Please copy and paste the information and the complete stacktrace below when reporting an issue [ERROR] VM : OpenJDK 64-Bit Server VM [ERROR] Vendor : Amazon.com Inc. [ERROR] Version : 11.0.7+10-LTS [ERROR] Uptime : 16232 [ERROR] Input -> [ERROR] 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf [ERROR] 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. [ERROR] 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native [ERROR] 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus [ERROR] BootClassPathSupported : false [ERROR] [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.5.2:mutationCoverage (default-cli) on project PmdPlus: Execution default-cli of goal org.pitest:pitest-maven:1.5.2:mutationCoverage failed: Coverage generation minion exited abnormally!
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16231 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16232 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.pitest:pitest-maven:1.5.2:mutationCoverage failed: Coverage generation minion exited abnormally!
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16231 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16232 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally!
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16231 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16232 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
at org.pitest.util.Unchecked.translateCheckedException (Unchecked.java:20)
at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage (DefaultCoverageGenerator.java:105)
at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage (DefaultCoverageGenerator.java:51)
at org.pitest.mutationtest.tooling.MutationCoverage.runReport (MutationCoverage.java:115)
at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:121)
at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:51)
at org.pitest.maven.RunPitStrategy.execute (RunPitStrategy.java:35)
at org.pitest.maven.AbstractPitMojo.analyse (AbstractPitMojo.java:463)
at org.pitest.maven.AbstractPitMojo.execute (AbstractPitMojo.java:404)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally!
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Amazon.com Inc. Version : 11.0.7+10-LTS Uptime : 16231 Input -> 1 : -Dclassworlds.conf=C:\j3\apache-maven-3.6.3\bin..\bin\m2.conf 2 : -Dmaven.home=C:\j3\apache-maven-3.6.3\bin.. 3 : -Dlibrary.jansi.path=C:\j3\apache-maven-3.6.3\bin..\lib\jansi-native 4 : -Dmaven.multiModuleProjectDirectory=C:\try\pitest\PmdPlus BootClassPathSupported : false
at org.pitest.coverage.execute.DefaultCoverageGenerator.gatherCoverageData (DefaultCoverageGenerator.java:148)
at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage (DefaultCoverageGenerator.java:89)
at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage (DefaultCoverageGenerator.java:51)
at org.pitest.mutationtest.tooling.MutationCoverage.runReport (MutationCoverage.java:115)
at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:121)
at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:51)
at org.pitest.maven.RunPitStrategy.execute (RunPitStrategy.java:35)
at org.pitest.maven.AbstractPitMojo.analyse (AbstractPitMojo.java:463)
at org.pitest.maven.AbstractPitMojo.execute (AbstractPitMojo.java:404)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
The problem seems to be twofold: 1) a custom runner is used (PMDTestRunner). 2) this results in a description that has classname "Unit Tests". This results in a ClassNotFoundException.
If I get all children recursively and then ignore ClassNotFoundExceptions and all descriptions that are not tests, I get my pitest report which seems OK.
The code I changed/added is in JUnitCustomRunnerTestUnitFinder:
private List<TestUnit> splitIntoFilteredUnits(final Description description) {
final ArrayList<Description> allChildren = getChildren(description);
return allChildren.stream()
.filter(description1 -> {
try {
LOG.log(Level.SEVERE, "PitErrorx?:" + description1.getDisplayName() + ":" + description1.getClassName());
IsolationUtils.convertForClassLoader(
IsolationUtils.getContextClassLoader(), description1.getClassName());
} catch (PitError classNotFoundException) {
LOG.log(Level.SEVERE, "PitErrorx:" + description1.getDisplayName() + ":" + description1.getClassName());
return false;
}
return true;
})
.filter(isTest())
.map(descriptionToTestUnit())
.collect(Collectors.toList());
}
private ArrayList<Description> getChildren(Description description) {
final ArrayList<Description> collect = description.getChildren().stream()
.map(child -> {
return getChildren(child);
}).collect(ArrayList<Description>::new, ArrayList::addAll, ArrayList::addAll);
collect.add(description);
return collect;
}
(just some prototyping)
However, using this code results in test errors:
Failed tests: JUnitCustomRunnerTestUnitFinderTest.shouldNotFindTestsInCustomSuite:152 null JUnitCustomRunnerTestUnitFinderTest.shouldNotFindTestsInNestedCustomSuites:176 null JUnitCustomRunnerTestUnitFinderTest.shouldNotHaltWhenRunnerThrowsRuntimeException:372 null TestJUnitConfiguration.shouldSplitTestInSuitesIntoSeperateUnitsWhenUsingNonStandardSuiteRunners:414 expected:<4> but was:<8>
So, I started investigating tests 1&2 and I do not understand them.
In JUnitCustomRunnerTestUnitFinderTest::shouldNotFindTestsInCustomSuite there are 0 test units expected. I would expect 4, as there is one suite of 2 classes with each 2 methods.
Can someone explain why there are only 0 expected?
And furthermore: can somebody explain to me what TestUnitFinder::findTestUnits must return?
In comparison: in ParameterisedJUnitTestFinderTest::shouldCreateTestUnitForEachParameterMethodCombinationOfParameterizedTest there are 8 test units returned. Which sounds logical to me as there four parameters and two test methods.
Thanks in advance!
Hi @michielgkalkman sorry for the slow response.
Supporting the unbounded set of possible junit runners is a bit of nightmare and the code is not pretty. Pitest has a long standing design flaw in that it always tries to split tests down into smaller units of execution, and maintains a blacklist of customer runners for which this doesn't work. It should really be the other way round with a whitelist.
I suspect that PMDTestRunner falls into this category, and the fix that you need is as simple as adding it to the blacklist in JUnitCustomRunnerTestUnitFinder
private boolean runnerCannotBeSplit(final Runner runner) {
final String runnerName = runner.getClass().getName();
return runnerName.equals("junitparams.JUnitParamsRunner")
|| runnerName.startsWith("org.spockframework.runtime.Sputnik")
|| runnerName.startsWith("com.insightfullogic.lambdabehave")
|| runnerName.startsWith("com.googlecode.yatspec")
|| runnerName.startsWith("com.google.gwtmockito.GwtMockitoTestRunner");
}
That said, unless PMDTestRunner does something different from what I assume it does, then it probably makes most sense to exclude it completely from being run by test.
These "tests" are not really tests - they will not be execute any of the code under test, just run style rules against their source. They could never kill a mutant generated at the bytecode level.
According to the PMD project I found at github the PMDTestRunner is part of the PMD test framework. It doesn't check code style but tests the detection rules for PMD themselves.
Thus it doesn't make sense to exclude it completely but it might be necessary to prevent it from being split.
Please have a look at https://github.com/michielgkalkman/PmdPlus/commit/fd84044f487517307c5b3772841d710f4179da3e
When running mvn -e clean install org.pitest:pitest-maven:mutationCoverage
I get a PitError: Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormall y!
See the entire stacktrace below.
BTW: maybe it is an idea to add the location where the issue needs to be reported, because I wondered for while whether it was a vm issue or not.
Thanks and regards, Michiel