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

java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsPrimitiveVoid(java.lang.reflect.Method)' #108

Open
kkocel opened this issue Dec 12, 2024 · 8 comments

Comments

@kkocel
Copy link

kkocel commented Dec 12, 2024

When running with Jupiter 5.11.3

4:20:58 PM PIT >> INFO : Project base directory is null
4:20:58 PM PIT >> INFO : ---------------------------------------------------------------------------
4:20:58 PM PIT >> INFO : Enabled (+) and disabled (-) features.
4:20:58 PM PIT >> INFO : -----------------------------------------
4:20:58 PM PIT >> INFO : +fann           Filters mutations in classes and methods with matching annotations of class or runtime retention
4:20:58 PM PIT >> INFO :   [annotation]    Annotation to avoid (full package name not required)
4:20:58 PM PIT >> INFO : +fassert        Filters mutations in compiler generated code for assertions
4:20:58 PM PIT >> INFO : +fenum          Filters junk mutations in enums
4:20:58 PM PIT >> INFO : +feswitch       Filters mutations in switch statements on enums
4:20:58 PM PIT >> INFO : +ffblock        Filters mutations in code duplicated by finally block inlining
4:20:58 PM PIT >> INFO : +ffeach         Filters mutations in compiler generated code that implements for each loops
4:20:58 PM PIT >> INFO : +ffloop         Filters any mutations to increments in for loops as they may cause timeouts
4:20:58 PM PIT >> INFO : +fgroovy        Filters out junk mutations in groovy code
4:20:58 PM PIT >> INFO : +finfinc        Filters mutations to increments that may cause infinite loops
4:20:58 PM PIT >> INFO : +finfit         Filters mutations that may cause infinite loops by removing calls to iterator.next
4:20:58 PM PIT >> INFO : +finull         Filters mutations in compiler generated code that checks for null by calling getClass
4:20:58 PM PIT >> INFO : +fkotlin        Filters out junk mutations in bytecode created by compiler for kotlin language features
4:20:58 PM PIT >> INFO : +flogcall       Filters mutations in code that makes calls to logging frameworks
4:20:58 PM PIT >> INFO : +fmrnull        Filters mutations in compiler generated code that inserts Objects.requireNonNull for method references
4:20:58 PM PIT >> INFO : +frecord        Filters mutations in compiler generated record code
4:20:58 PM PIT >> INFO : +fretequiv      Filters return vals mutants with bytecode equivalent to the unmutated class
4:20:58 PM PIT >> INFO : +fsequivdiv     Filters equivalent mutations of the form x * -1 -> x / -1
4:20:58 PM PIT >> INFO : +fsequivequals  Filters equivalent mutations that affect only performance in short cutting equals methods
4:20:58 PM PIT >> INFO : +fstati         Filters mutations in static initializers and code called only from them
4:20:58 PM PIT >> INFO : +fstrswitch     Filters mutations in compiler generated code for string switch statements
4:20:58 PM PIT >> INFO : +ftrywr         Filters mutations in code generated for try with resources statements
4:20:58 PM PIT >> INFO : +macos_focus    Auto add java.awt.headless=true to keep keyboard focus on Mac OS
4:20:58 PM PIT >> INFO : -auto_threads   Auto set number of threads based on machine
4:20:58 PM PIT >> INFO : -classlimit     Limits the maximum number of mutations per class
4:20:58 PM PIT >> INFO :   [limit]         Integer value for maximum mutations to create per class
4:20:58 PM PIT >> INFO : -export         Exports mutants bytecode and other details to disk
4:20:58 PM PIT >> INFO : -nofirstline    Filters mutants with line number <= 1
4:20:58 PM PIT >> INFO : ---------------------------------------------------------------------------
4:20:58 PM PIT >> FINE : Running report with ReportOptions[targetClasses=[com.example.*], excludedMethods=[], excludedClasses=[], excludedTestClasses=[], codePaths=[...]
4:20:58 PM PIT >> FINE : Maximum available memory is 8192 mb
4:20:58 PM PIT >> INFO : Created 37 mutation test units in pre scan
4:20:58 PM PIT >> FINE : MINION : Installing PIT agent
4:20:58 PM PIT >> INFO : Sending 54 test classes to minion
4:20:58 PM PIT >> INFO : Sent tests to minion
4:20:58 PM PIT >> INFO : MINION : 4:20:58 PM PIT >> FINE : Expecting 54 tests classes from parent
4:20:58 PM PIT >> INFO : MINION : 4:20:58 PM PIT >> FINE : Tests classes received
4:20:58 PM PIT >> INFO : MINION : 4:20:58 PM PIT >> INFO : Checking environment
4:20:58 PM PIT >> FINE : MINION : org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:110)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.junit5.JUnit5TestUnitFinder.findTestUnits(JUnit5TestUnitFinder.java:83)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.mutationtest.config.PrioritisingTestUnitFinder.findTestUnits(PrioritisingTestUnitFinder.java:20)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.testapi.execute.FindTestUnits.findTestUnits(FindTestUnits.java:64)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.testapi.execute.FindTestUnits.getTestUnits(FindTestUnits.java:47)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.testapi.execute.FindTestUnits.findTestUnitsForAllSuppliedClasses(FindTestUnits.java:36)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.coverage.execute.CoverageMinion.discoverTests(CoverageMinion.java:177)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.coverage.execute.CoverageMinion.getTestsFromParent(CoverageMinion.java:163)
4:20:58 PM PIT >> FINE : MINION : 	at org.pitest.coverage.execute.CoverageMinion.main(CoverageMinion.java:87)
4:20:58 PM PIT >> FINE : MINION : Caused by: org.junit.platform.commons.JUnitException: ClassSelector [className = 'com.example.MyTest'] resolution failed
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:48)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
4:20:58 PM PIT >> FINE : MINION : 	... 15 more
4:20:58 PM PIT >> FINE : MINION : Caused by: java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsPrimitiveVoid(java.lang.reflect.Method)'
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1368)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1267)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:67)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:135)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
4:20:58 PM PIT >> FINE : MINION : 	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:126)
4:20:58 PM PIT >> FINE : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
4:20:58 PM PIT >> FINE : MINION : 	... 20 more
4:20:58 PM PIT >> INFO : MINION : 4:20:58 PM PIT >> SEVERE : Error calculating coverage. Process will exit.
4:20:58 PM PIT >> INFO : MINION : org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:110)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.junit5.JUnit5TestUnitFinder.findTestUnits(JUnit5TestUnitFinder.java:83)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.mutationtest.config.PrioritisingTestUnitFinder.findTestUnits(PrioritisingTestUnitFinder.java:20)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.testapi.execute.FindTestUnits.findTestUnits(FindTestUnits.java:64)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.testapi.execute.FindTestUnits.getTestUnits(FindTestUnits.java:47)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.testapi.execute.FindTestUnits.findTestUnitsForAllSuppliedClasses(FindTestUnits.java:36)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.coverage.execute.CoverageMinion.discoverTests(CoverageMinion.java:177)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.coverage.execute.CoverageMinion.getTestsFromParent(CoverageMinion.java:163)
4:20:58 PM PIT >> INFO : MINION : 	at org.pitest.coverage.execute.CoverageMinion.main(CoverageMinion.java:87)
4:20:58 PM PIT >> INFO : MINION : Caused by: org.junit.platform.commons.JUnitException: ClassSelector [className = 'com.example.MyTest'] resolution failed
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:48)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
4:20:58 PM PIT >> INFO : MINION : 	... 15 more
4:20:58 PM PIT >> INFO : MINION : Caused by: java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsPrimitiveVoid(java.lang.reflect.Method)'
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1368)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1267)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:67)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:135)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
4:20:58 PM PIT >> INFO : MINION : 	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:126)
4:20:58 PM PIT >> INFO : MINION : 	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
4:20:58 PM PIT >> INFO : MINION : 	... 20 more
4:20:58 PM PIT >> SEVERE : Coverage generator Minion exited abnormally due to UNKNOWN_ERROR
Exception in thread "main" 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 : BellSoft
Version : 21.0.5+11-LTS
Uptime : 803
Input -> 
 1 : -Dfile.encoding=UTF-8
 2 : -Duser.country=PL
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : false


Please copy and paste the information and the complete stacktrace below when reporting an issue
VM : OpenJDK 64-Bit Server VM
Vendor : BellSoft
Version : 21.0.5+11-LTS
Uptime : 803
Input -> 
 1 : -Dfile.encoding=UTF-8
 2 : -Duser.country=PL
 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:118)
	at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:53)
	at org.pitest.mutationtest.tooling.MutationCoverage.runAnalysis(MutationCoverage.java:149)
	at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:136)
	at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:136)
	at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:63)
	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 : BellSoft
Version : 21.0.5+11-LTS
Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally! (UNKNOWN_ERROR)

Uptime : 803
Input -> 
 1 : -Dfile.encoding=UTF-8
 2 : -Duser.country=PL
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : false

	at org.pitest.coverage.execute.DefaultCoverageGenerator.gatherCoverageData(DefaultCoverageGenerator.java:157)
	at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:101)
	... 7 more
@hcoles
Copy link
Contributor

hcoles commented Dec 12, 2024

@kkocel

This sort of issue is usually due to a mismatch between the junit platform and jupiter versions. How are you running pitest (maven, gradle, other)? What versions are you using of pitest and the junit 5 plugin? Do you have any explicit dependencies on junit platform?

@szpak
Copy link
Contributor

szpak commented Dec 12, 2024

Assuming Gradle, you should get information about the automatically added junit-related dependencies, when use --info. In additional, as Henry suggested, you could use dependencyInsight to check what deps you have already in your project.

@kkocel
Copy link
Author

kkocel commented Dec 13, 2024

Yes, I use Gradle plugin.

My Junit5 dependencies:

|    +--- org.junit.jupiter:junit-jupiter:5.11.3 -> 5.8.2
|    |    +--- org.junit:junit-bom:5.8.2 -> 5.11.3
|    |    |    +--- org.junit.jupiter:junit-jupiter:5.11.3 -> 5.8.2 (c)
|    |    |    +--- org.junit.jupiter:junit-jupiter-api:5.11.3 (c)
|    |    |    +--- org.junit.jupiter:junit-jupiter-engine:5.11.3 (c)
|    |    |    +--- org.junit.jupiter:junit-jupiter-params:5.11.3 (c)
|    |    |    +--- org.junit.platform:junit-platform-commons:1.11.3 (c)
|    |    |    +--- org.junit.platform:junit-platform-engine:1.11.3 (c)
|    |    |    \--- org.junit.platform:junit-platform-launcher:1.11.3 (c)
|    |    +--- org.junit.jupiter:junit-jupiter-api:5.8.2 -> 5.11.3
|    |    |    +--- org.junit:junit-bom:5.11.3 (*)
|    |    |    +--- org.opentest4j:opentest4j:1.3.0
|    |    |    \--- org.junit.platform:junit-platform-commons:1.11.3
|    |    |         \--- org.junit:junit-bom:5.11.3 (*)
|    |    +--- org.junit.jupiter:junit-jupiter-params:5.8.2 -> 5.11.3
|    |    |    +--- org.junit:junit-bom:5.11.3 (*)
|    |    |    \--- org.junit.jupiter:junit-jupiter-api:5.11.3 (*)
|    |    \--- org.junit.jupiter:junit-jupiter-engine:5.8.2 -> 5.11.3
|    |         +--- org.junit:junit-bom:5.11.3 (*)
|    |         +--- org.junit.platform:junit-platform-engine:1.11.3
|    |         |    +--- org.junit:junit-bom:5.11.3 (*)
|    |         |    +--- org.opentest4j:opentest4j:1.3.0
|    |         |    \--- org.junit.platform:junit-platform-commons:1.11.3 (*)
|    |         \--- org.junit.jupiter:junit-jupiter-api:5.11.3 (*)
...
+--- org.junit.jupiter:junit-jupiter:5.8.2 (*)
+--- org.junit.platform:junit-platform-launcher:1.11.3
|    +--- org.junit:junit-bom:5.11.3 (*)
|    \--- org.junit.platform:junit-platform-engine:1.11.3 (*)
\--- org.junit.platform:junit-platform-launcher -> 1.11.3 (*)

And my plugin config:

    pitest {
        junit5PluginVersion = "1.0.0"
        avoidCallsTo = setOf("kotlin.jvm.internal")
        mutators = setOf("STRONGER")
        exportLineCoverage = true
        verbose = true
        targetClasses = setOf("com.example.*")
        targetTests = setOf("com.example.*", "org.springframework.web.servlet.mvc.method.annotation.*")
        threads = Runtime.getRuntime().availableProcessors()
        reportAggregator {
            junit5PluginVersion = "1.1.2"
            verbose = true
            exportLineCoverage = true
            testStrengthThreshold = 50
            mutationThreshold = 75
            coverageThreshold = 60
            maxSurviving = 3
        }
        outputFormats = setOf("XML", "HTML")

    }
}

I tried both 1.0.0 and 1.1.2

@hcoles
Copy link
Contributor

hcoles commented Dec 13, 2024

What happens if you use the latest version of of junit5 plugin (1.2.1)?

(you will need to also set pitestVersion="1.17.2" in order to use it. At the moment you are using the default version supplied by the gradle plugin, which is very old.)

@kkocel
Copy link
Author

kkocel commented Dec 13, 2024

@hcoles I updated my config:

    pitest {
        pitestVersion = "1.17.2"
        junit5PluginVersion = "1.1.2"
        avoidCallsTo = setOf("kotlin.jvm.internal")
        mutators = setOf("STRONGER")
        exportLineCoverage = true
        verbose = true
        targetClasses = setOf("com.example.*")
        targetTests = setOf("com.example.*", "org.springframework.web.servlet.mvc.method.annotation.*")
        threads = Runtime.getRuntime().availableProcessors()
        reportAggregator {
            pitestVersion = "1.17.2"
            junit5PluginVersion = "1.1.2"
            verbose = true
            exportLineCoverage = true
            testStrengthThreshold = 50
            mutationThreshold = 75
            coverageThreshold = 60
            maxSurviving = 3
        }
        outputFormats = setOf("XML", "HTML")
    }

however, I still get the same error

@hcoles
Copy link
Contributor

hcoles commented Dec 13, 2024

Are you using the latest version of the gradle plugin?

@kkocel
Copy link
Author

kkocel commented Dec 13, 2024

@hcoles I use "1.15.0" so I guess it's the latest one.

@szpak
Copy link
Contributor

szpak commented Dec 13, 2024

GPP itself shouldn't impose any JUnit 5 version, if overridden in configuration :-/.

Btw:

|    |    |    +--- org.junit.jupiter:junit-jupiter:5.11.3 -> 5.8.2 (c)
|    |    |    +--- org.junit.jupiter:junit-jupiter-api:5.11.3 (c)

Why something enforces 5.8.2 here, and 5.11.3 there?

Junit-jupiter 5.8.2 is compatible with junit-plaform 1.8.2, not 1.11.3:

JUnit 5.8.2 = Platform 1.8.2 + Jupiter 5.8.2 + Vintage 5.8.2

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

3 participants