Skip to content

JUnitPlatformFeature unexpectedly failed with a JUnitException #541

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

Closed
danthe1st opened this issue Nov 24, 2023 · 24 comments
Closed

JUnitPlatformFeature unexpectedly failed with a JUnitException #541

danthe1st opened this issue Nov 24, 2023 · 24 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists junit-support Related to JUnit Support project

Comments

@danthe1st
Copy link

danthe1st commented Nov 24, 2023

Before reporting

  • This repository should be used to report issues on the Maven or Gradle plugins for GraalVM.
  • Please report issues which are specific to the Spring Framework or the Micronaut framework to their specific repositories.
  • Do not report issues with building your specific application, e.g errors which happen at image build time like classes initialized at build time, or missing classes as run time: those are not related to the plugins but problems with configuration. You can refer to the GraalVM native image documentation for available options and the plugins documentation for how to use them with the plugin.

Describe the bug

When overriding an @Test method and without marking the overridden method with @Test, compilation of the test fails with Error: Feature defined by org.graalvm.junit.platform.JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException. Please report this problem to the authors of org.graalvm.junit.platform.JUnitPlatformFeature..

To Reproduce

  • Create a Maven Project with JUnit and the Native Maven Plugin
  • Create a test class with an @Test method
  • Create another class extending that class and overriding the method
    • Do not mark the overridden method in the subclass with @Test
<dependencies>
	<dependency>
		<groupId>org.junit.jupiter</groupId>
		<artifactId>junit-jupiter-api</artifactId>
		<version>5.10.1</version>
	</dependency>
</dependencies>
<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.11.0</version>
			<configuration>
				<release>17</release>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.graalvm.buildtools</groupId>
			<artifactId>native-maven-plugin</artifactId>
			<version>0.9.28</version>
			<extensions>true</extensions>
			<executions>
				<execution>
					<id>build-native</id>
					<goals>
						<goal>compile-no-fork</goal>
					</goals>
					<phase>package</phase>
				</execution>
				<execution>
					<id>test-native</id>
					<goals>
						<goal>test</goal>
					</goals>
					<phase>test</phase>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>3.2.2</version>
		</plugin>
	</plugins>
</build>
mvn test
import org.junit.jupiter.api.Test;

class SuperTest {
	@Test
	public void test() throws Exception {

	}
}
class SubTest extends SuperTest {
	@Override
	public void test() throws Exception {
	}
}

See this minimal reproducer (CI log here)

Expected behavior

Native compilation of tests succeed and the tests run successfully.

Logs

[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.github.danthe1st.junitfeaturefailure.SubTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.048 s -- in io.github.danthe1st.junitfeaturefailure.SubTest
[INFO] Running io.github.danthe1st.junitfeaturefailure.SuperTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s -- in io.github.danthe1st.junitfeaturefailure.SuperTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- native-maven-plugin:0.9.28:test (test-native) @ junit-feature-failure ---
[INFO] ====================
[INFO] Initializing project: junit-feature-failure
[INFO] ====================
[INFO] Found GraalVM installation from GRAALVM_HOME variable.
[INFO] Executing: /opt/hostedtoolcache/graalvm-community-jdk-21.0.1_linux-x64_bin/21.0.1/x64/graalvm-community-openjdk-21.0.1+12.1/bin/native-image -cp /home/runner/work/junit-feature-failure/junit-feature-failure/target/test-classes:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.1/junit-jupiter-api-5.10.1.jar:/home/runner/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-commons/1.10.1/junit-platform-commons-1.10.1.jar:/home/runner/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/home/runner/.m2/repository/org/graalvm/buildtools/native-maven-plugin/0.9.28/native-maven-plugin-0.9.28.jar:/home/runner/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.9.28/junit-platform-native-0.9.28.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-console/1.10.0/junit-platform-console-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-reporting/1.10.0/junit-platform-reporting-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.0/junit-platform-launcher-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-engine/1.10.0/junit-platform-engine-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-commons/1.10.0/junit-platform-commons-1.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.0/junit-jupiter-5.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.0/junit-jupiter-api-5.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.0/junit-jupiter-params-5.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.0/junit-jupiter-engine-5.10.0.jar:/home/runner/.m2/repository/org/graalvm/buildtools/utils/0.9.28/utils-0.9.28.jar:/home/runner/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.9.28/graalvm-reachability-metadata-0.9.28.jar:/home/runner/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.9.28/junit-platform-native-0.9.28.jar --no-fallback -o /home/runner/work/junit-feature-failure/junit-feature-failure/target/native-tests -Djunit.platform.listeners.uid.tracking.output.dir=/home/runner/work/junit-feature-failure/junit-feature-failure/target/test-ids --features=org.graalvm.junit.platform.JUnitPlatformFeature org.graalvm.junit.platform.NativeImageJUnitLauncher
========================================================================================================================
GraalVM Native Image: Generating 'native-tests' (executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing...                                                                                    (3.9s @ 0.07GB)
 Java version: 21.0.1+12, vendor version: GraalVM CE 21.0.1+12.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (linux, x86_64, 11.4.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 2 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - org.graalvm.junit.platform.JUnitPlatformFeature
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 10.80GB of memory (69.2% of 15.61GB system memory, determined at start)
 - 4 thread(s) (100.0% of 4 available processor(s), determined at start)
[junit-platform-native] Running in 'test listener' mode using files matching pattern [junit-platform-unique-ids*] found in folder [/home/runner/work/junit-feature-failure/junit-feature-failure/target/test-ids] and its subfolders.

Error: Feature defined by org.graalvm.junit.platform.JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException. Please report this problem to the authors of org.graalvm.junit.platform.JUnitPlatformFeature.
------------------------------------------------------------------------------------------------------------------------
                        0.3s (5.6% of total time) in 12 GCs | Peak RSS: 0.44GB | CPU load: 2.65
========================================================================================================================
Finished generating 'native-tests' in 4.1s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.508 s
[INFO] Finished at: 2023-11-25T22:19:26Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.28:test (test-native) on project junit-feature-failure: Execution of /opt/hostedtoolcache/graalvm-community-jdk-21.0.1_linux-x64_bin/21.0.1/x64/graalvm-community-openjdk-21.0.1+12.1/bin/native-image -cp /home/runner/work/junit-feature-failure/junit-feature-failure/target/test-classes:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.1/junit-jupiter-api-5.10.1.jar:/home/runner/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-commons/1.10.1/junit-platform-commons-1.10.1.jar:/home/runner/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/home/runner/.m2/repository/org/graalvm/buildtools/native-maven-plugin/0.9.28/native-maven-plugin-0.9.28.jar:/home/runner/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.9.28/junit-platform-native-0.9.28.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-console/1.10.0/junit-platform-console-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-reporting/1.10.0/junit-platform-reporting-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.0/junit-platform-launcher-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-engine/1.10.0/junit-platform-engine-1.10.0.jar:/home/runner/.m2/repository/org/junit/platform/junit-platform-commons/1.10.0/junit-platform-commons-1.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.0/junit-jupiter-5.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.0/junit-jupiter-api-5.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.0/junit-jupiter-params-5.10.0.jar:/home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.0/junit-jupiter-engine-5.10.0.jar:/home/runner/.m2/repository/org/graalvm/buildtools/utils/0.9.28/utils-0.9.28.jar:/home/runner/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.9.28/graalvm-reachability-metadata-0.9.28.jar:/home/runner/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.9.28/junit-platform-native-0.9.28.jar --no-fallback -o /home/runner/work/junit-feature-failure/junit-feature-failure/target/native-tests -Djunit.platform.listeners.uid.tracking.output.dir=/home/runner/work/junit-feature-failure/junit-feature-failure/target/test-ids --features=org.graalvm.junit.platform.JUnitPlatformFeature org.graalvm.junit.platform.NativeImageJUnitLauncher returned non-zero result -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
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/MojoExecutionException
Error: Process completed with exit code 1.

Full logs here

System Info (please complete the following information):

  • OS: Linux
  • GraalVM Version: graalvm-community-jdk-21.0.1_linux-x64_bin
  • Java Version 21
  • Plugin version native-maven-plugin:0.9.28

Additional context

Full reproducer here

@danthe1st danthe1st added the bug Something isn't working label Nov 24, 2023
@danthe1st danthe1st changed the title JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException @Disabled with native tests: JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException Nov 24, 2023
@danthe1st
Copy link
Author

I am reporting this here since JUnitPlatformFeature seems to be part of this repository.

@danthe1st danthe1st changed the title @Disabled with native tests: JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException Overridden test: JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException Nov 25, 2023
@danthe1st danthe1st changed the title Overridden test: JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException Overridden test method: JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException Nov 25, 2023
@danthe1st
Copy link
Author

@dnestoro Is there a chance at getting this triaged?

@melix
Copy link
Collaborator

melix commented Feb 1, 2024

Possibly fixed by #565 although I have not checked.

@danthe1st
Copy link
Author

danthe1st commented Feb 2, 2024

Possibly fixed by #565 although I have not checked.

It seems to still be the case in 0.10.0. I have updated the reproducer. nvm that PR isn't merged yet

@danthe1st
Copy link
Author

@danthe1st
Copy link
Author

Still happens with 0.10.2.

@stevenschlansker
Copy link

We're seeing this exception on 0.10.3 as well.

@danthe1st
Copy link
Author

@stevenschlansker As a workaround, you can mark the overridden method with @Test.

@stevenschlansker
Copy link

@danthe1st , thanks for the suggestion but ... which test case? The error message does not print out which test case causes the failure, and we have thousands of tests :( I suppose I can narrow the search to a test class that extends another, but still. If this issue really won't be fixed I will eventually invest the time to look at doing so... but given the number of users reporting this, I will hope for a fix in the next release for now :)

@danthe1st
Copy link
Author

@stevenschlansker
Yeah I had the same issue. Essentially look at overridden test methods that aren't annotated with @Test. You can also write some scripts for automating that.

@stevenschlansker
Copy link

Unfortunately this issue still exists in 0.10.4.

@danthe1st
Copy link
Author

danthe1st commented Dec 19, 2024

If you care sufficiently about the issue, you can probably contribute a fix (though you'd probably need to sign the OCA). I wouldn't really expect it to be fixed without anyone interested in it to be honest (and it's possible to work around the issue).

@luis100
Copy link

luis100 commented Dec 20, 2024

Upgrading installed java to 23.0.1-graal solved the issue for me. Also dependencies need to be updated junit-platform-commons to 1.11.4 and junit-jupiter-engine and junit-jupiter-api to 5.11.4.

@danthe1st
Copy link
Author

@luis100 The issue still happens with my reproducer using the latest versions
That build is using:

  • GraalVM CE 23.0.1+11.1
  • junit-jupiter-api 5.11.4
  • maven-surefire-plugin 3.5.2
  • native-maven-plugin 0.10.4

@sbrannen sbrannen added the junit-support Related to JUnit Support project label Mar 3, 2025
@Marcono1234
Copy link

For anyone experiencing this: You can add the following to the native-maven-plugin <configuration> in your POM to see the actual JUnitException which was thrown:

<buildArgs>
  <buildArg>-H:+ReportExceptionStackTraces</buildArg>
</buildArgs>

This might make it easier to understand why the exception occurred.

@danthe1st
Copy link
Author

Thanks @Marcono1234.
I have updated my reproducer to use this option and I'm including the stack trace here.

Error: Feature defined by org.graalvm.junit.platform.JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException. Please report this problem to the authors of org.graalvm.junit.platform.JUnitPlatformFeature.
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:77)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:56)
	at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:135)
	at org.graalvm.junit.platform.JUnitPlatformFeature.beforeAnalysis(JUnitPlatformFeature.java:94)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:93)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:554)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:528)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:711)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:139)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
Caused by: org.junit.platform.commons.JUnitException: UniqueIdSelector [uniqueId = [engine:junit-jupiter]/[class:io.github.danthe1st.junitfeaturefailure.SuperTest]/[method:test()]] resolution failed
	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	... 18 more
Caused by: java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsVoid(java.lang.reflect.Method)'
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
	at org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1560)
	at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1409)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:27)
	at java.base/java.util.Optional.filter(Optional.java:218)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:96)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.access$100(EngineDiscoveryRequestResolution.java:58)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.resolve(EngineDiscoveryRequestResolution.java:228)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:222)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.resolveUniqueIdIntoTestDescriptor(MethodSelectorResolver.java:224)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.access$200(MethodSelectorResolver.java:164)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.lambda$resolve$4(MethodSelectorResolver.java:117)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1034)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:133)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
	... 23 more
Caused by: org.junit.platform.commons.JUnitException: UniqueIdSelector [uniqueId = [engine:junit-jupiter]/[class:io.github.danthe1st.junitfeaturefailure.SuperTest]/[method:test()]] resolution failed
	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:77)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:56)
	at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:135)
	at org.graalvm.junit.platform.JUnitPlatformFeature.beforeAnalysis(JUnitPlatformFeature.java:94)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:93)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:554)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:528)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:711)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:139)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
Caused by: java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsVoid(java.lang.reflect.Method)'
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
	at org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1560)
	at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1409)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:27)
	at java.base/java.util.Optional.filter(Optional.java:218)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:96)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.access$100(EngineDiscoveryRequestResolution.java:58)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.resolve(EngineDiscoveryRequestResolution.java:228)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:222)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.resolveUniqueIdIntoTestDescriptor(MethodSelectorResolver.java:224)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.access$200(MethodSelectorResolver.java:164)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.lambda$resolve$4(MethodSelectorResolver.java:117)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1034)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:133)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
	... 23 more
Caused by: java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsVoid(java.lang.reflect.Method)'
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
	at org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1560)
	at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1409)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:27)
	at java.base/java.util.Optional.filter(Optional.java:218)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:96)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.access$100(EngineDiscoveryRequestResolution.java:58)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.resolve(EngineDiscoveryRequestResolution.java:228)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:222)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.resolveUniqueIdIntoTestDescriptor(MethodSelectorResolver.java:224)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.access$200(MethodSelectorResolver.java:164)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.lambda$resolve$4(MethodSelectorResolver.java:117)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1034)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:133)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:77)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:56)
	at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:135)
	at org.graalvm.junit.platform.JUnitPlatformFeature.beforeAnalysis(JUnitPlatformFeature.java:94)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:93)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:554)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:528)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:711)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:139)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
Internal exception: com.oracle.svm.core.util.UserError$UserException: Feature defined by org.graalvm.junit.platform.JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException. Please report this problem to the authors of org.graalvm.junit.platform.JUnitPlatformFeature.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:97)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.handleFeatureError(FeatureHandler.java:299)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:95)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:554)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:528)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:711)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:139)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:77)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:56)
	at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:135)
	at org.graalvm.junit.platform.JUnitPlatformFeature.beforeAnalysis(JUnitPlatformFeature.java:94)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:822)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:93)
	... 7 more
Caused by: org.junit.platform.commons.JUnitException: UniqueIdSelector [uniqueId = [engine:junit-jupiter]/[class:io.github.danthe1st.junitfeaturefailure.SuperTest]/[method:test()]] resolution failed
	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	... 18 more
Caused by: java.lang.NoSuchMethodError: 'boolean org.junit.platform.commons.util.ReflectionUtils.returnsVoid(java.lang.reflect.Method)'
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:48)
	at org.junit.jupiter.engine.discovery.predicates.IsTestMethod.test(IsTestMethod.java:23)
	at org.junit.jupiter.engine.discovery.predicates.IsTestableMethod.test(IsTestableMethod.java:26)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at java.base/java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1560)
	at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1409)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
	at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:27)
	at java.base/java.util.Optional.filter(Optional.java:218)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:96)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.access$100(EngineDiscoveryRequestResolution.java:58)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.resolve(EngineDiscoveryRequestResolution.java:228)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:222)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.resolveUniqueIdIntoTestDescriptor(MethodSelectorResolver.java:224)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.access$200(MethodSelectorResolver.java:164)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.lambda$resolve$4(MethodSelectorResolver.java:117)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1034)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:133)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1686)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
	... 23 more

@sbrannen
Copy link
Collaborator

Hi @danthe1st,

The stack trace points out that the ReflectionUtils.returnsVoid() method could not be found.

That method was renamed to returnsPrimitiveVoid() in JUnit 5.11.

Thus, it appears that the versions of junit-jupiter-engine and junit-platform-commons in your project are incompatible. Have you checked the versions present in your dependency tree?

This is also related to:

Aligning the versions of JUnit artifacts should hopefully resolve the problem for you.

What happens if you use the JUnit BOM?

@danthe1st
Copy link
Author

danthe1st commented Mar 16, 2025

@sbrannen I updated my reproducer to use JUnit 5.12.1 using the BOM (previously I only declared junit-jupiter-api without any other dependencies).
The exception still occurs.
Build log here.
Output of mvn dependency:tree:

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------------------< io.github.danthe1st:junit-feature-failure >---------------------------------------
[INFO] Building junit-feature-failure 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------
[INFO] 
[INFO] --- dependency:3.8.1:tree (default-cli) @ junit-feature-failure ---
[INFO] io.github.danthe1st:junit-feature-failure:jar:0.0.1-SNAPSHOT
[INFO] \- org.junit.jupiter:junit-jupiter-api:jar:5.12.1:compile
[INFO]    +- org.opentest4j:opentest4j:jar:1.3.0:compile
[INFO]    +- org.junit.platform:junit-platform-commons:jar:1.12.1:compile
[INFO]    \- org.apiguardian:apiguardian-api:jar:1.1.2:compile
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] --------------------------------------------------------------------------------------------------------------------------

(before that, it was using junit-jupiter-api:jar:5.11.4 and junit-platform-commons:jar:1.11.4:compile)

It guess that the native-maven-plugin might overwrite the version in some way.

@sbrannen
Copy link
Collaborator

I updated my reproducer to use JUnit 5.12.1 using the BOM (previously I only declared junit-jupiter-api without any other dependencies).

Thanks for trying out the BOM.

The log you shared shows that the versions of various JUnit artifacts are not being influenced by the JUnit BOM.

For example, /home/runner/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.0/junit-jupiter-engine-5.10.0.jar is on the classpath supplied to the native-image executable. So, that seems to be the problem.

Basically, it looks like the classpath for the native-image executable is being set up with default (potentially old and incompatible) JUnit versions that don't reflect the versions of those artifacts used by Maven Surefire when it executes your tests.

It probably will not be enough to sort things out, but what happens if you add an explicit dependency on junit-jupiter-engine in your Maven POM?

@sbrannen
Copy link
Collaborator

And now that I think about it, this sounds very similar to what I reported several years ago...

@danthe1st
Copy link
Author

danthe1st commented Mar 16, 2025

@sbrannen junit-platform-native has dependencies on junit 5.10.0. These are declared in this repository but I have no idea where it gets the version from.

@sbrannen
Copy link
Collaborator

@sbrannen junit-platform-native has dependencies on junit 5.10.0. These are declared in this repository but I have no idea where it gets the version from.

I think the versions are managed here.

And as @lazar-mitrovic pointed out, it could be that the following logic needs to be revised.

protected void addDependenciesToClasspath() throws MojoExecutionException {
super.addDependenciesToClasspath();
Set<Module> modules = new HashSet<>();
//noinspection SimplifyStreamApiCallChains
pluginArtifacts.stream()
// do not use peek as Stream implementations are free to discard it
.map(a -> {
modules.add(new Module(a.getGroupId(), a.getArtifactId()));
return a;
})
.filter(it -> it.getGroupId().startsWith(NativeImageConfigurationUtils.MAVEN_GROUP_ID) || it.getGroupId().startsWith("org.junit"))
.map(it -> it.getFile().toPath())
.forEach(imageClasspath::add);
var jars = findJunitPlatformNativeJars(modules);
imageClasspath.addAll(jars);
}

@danthe1st
Copy link
Author

danthe1st commented Mar 16, 2025

When I changed the version in my local ~/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.10.6/junit-platform-native-0.10.6.pom to the following (I changed the versions of junit-bom, junit-platform-console and junit-platform-launcher) and recalculated the sha1 hash, I got a different stack trace:

...
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>5.12.1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-console</artifactId>
      <version>1.12.1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <version>1.12.1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>
Error: Feature defined by org.graalvm.junit.platform.JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException. Please report this problem to the authors of org.graalvm.junit.platform.JUnitPlatformFeature.
com.oracle.svm.core.util.UserError$UserException: Feature defined by org.graalvm.junit.platform.JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException. Please report this problem to the authors of org.graalvm.junit.platform.JUnitPlatformFeature.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.handleFeatureError(FeatureHandler.java:289)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:92)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:773)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:539)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:165)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:105)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:77)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.junit.platform.launcher.core.InterceptingLauncher.lambda$discover$0(InterceptingLauncher.java:33)
	at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25)
	at org.junit.platform.launcher.core.InterceptingLauncher.discover(InterceptingLauncher.java:33)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:56)
	at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:135)
	at org.graalvm.junit.platform.JUnitPlatformFeature.beforeAnalysis(JUnitPlatformFeature.java:94)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$9(NativeImageGenerator.java:773)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:90)
	... 7 more
Caused by: org.junit.platform.commons.JUnitException: UniqueIdSelector [uniqueId = [engine:junit-jupiter]/[class:io.github.danthe1st.junitfeaturefailure.SuperTest]/[method:test()]] resolution failed
	at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:116)
	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:48)
	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	... 22 more
Caused by: java.lang.NoSuchMethodError: 'java.util.Optional org.junit.platform.commons.support.AnnotationSupport.findAnnotation(java.lang.Class, java.lang.Class, java.util.List)'
	at org.junit.jupiter.engine.descriptor.DisplayNameUtils.findDisplayNameGenerator(DisplayNameUtils.java:142)
	at org.junit.jupiter.engine.descriptor.DisplayNameUtils.lambda$createDisplayNameSupplier$6(DisplayNameUtils.java:127)
	at org.junit.jupiter.engine.descriptor.DisplayNameUtils.determineDisplayName(DisplayNameUtils.java:92)
	at org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.<init>(JupiterTestDescriptor.java:67)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.<init>(ClassBasedTestDescriptor.java:101)
	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.<init>(ClassTestDescriptor.java:51)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.newClassTestDescriptor(ClassSelectorResolver.java:121)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.lambda$resolve$5(ClassSelectorResolver.java:100)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.createAndAdd(EngineDiscoveryRequestResolution.java:250)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:213)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.lambda$resolve$6(ClassSelectorResolver.java:100)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:98)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.access$100(EngineDiscoveryRequestResolution.java:58)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.resolve(EngineDiscoveryRequestResolution.java:228)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:222)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.resolveUniqueIdIntoTestDescriptor(MethodSelectorResolver.java:226)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver$MethodType.access$200(MethodSelectorResolver.java:164)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.lambda$resolve$4(MethodSelectorResolver.java:117)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1034)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.junit.jupiter.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:133)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolveUniqueId$3(EngineDiscoveryRequestResolution.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveUniqueId(EngineDiscoveryRequestResolution.java:176)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:124)
	at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92)
	... 27 more

So these versions are in fact used. It still not working isn't surprising as it's probably still set in some other places but I guess this confirms that the version declared there is actually the issue.

Also when I run mvn -X on my reproducer with the normal version of junit-platform-native, the following is included in the output:

...
[DEBUG] Reading file model from com.github.openjson:openjson:1.0.13
[DEBUG] Reading file model from org.graalvm.buildtools:graalvm-reachability-metadata:0.10.6
[DEBUG] Reading file model from org.graalvm.buildtools:utils:0.10.6
[DEBUG] Reading file model from org.twdata.maven:mojo-executor:2.4.1
[DEBUG] Reading file model from org.cyclonedx:cyclonedx-maven-plugin:2.9.1
[DEBUG] Reading file model from org.junit:junit-bom:5.11.2
[DEBUG] Reading file model from org.twdata.maven:mojo-executor-parent:2.4.1
[DEBUG] Reading file model from org.apache.commons:commons-lang3:3.17.0
[DEBUG] Reading file model from commons-codec:commons-codec:1.17.1
[DEBUG] Reading file model from org.apache.maven.shared:maven-dependency-tree:3.3.0
[DEBUG] Reading file model from org.cyclonedx:cyclonedx-core-java:9.0.5
[DEBUG] Reading file model from org.apache.maven:maven:3.3.1
[DEBUG] Reading file model from org.apache.maven.shared:maven-shared-components:42
[DEBUG] Reading file model from org.apache.maven:maven-parent:42
[DEBUG] Reading file model from org.apache.commons:commons-parent:71
[DEBUG] Replacing repositories from org.cyclonedx:cyclonedx-core-java:jar:9.0.5
    central (https://repo.maven.apache.org/maven2, default, releases)
    maven-central (https://repo1.maven.org/maven2, default, releases+snapshots)
    ossrh-snapshot (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)
[DEBUG] Reading file model from org.apache.maven:maven-parent:26
[DEBUG] Reading file model from org.apache.maven.shared:maven-dependency-analyzer:1.14.1
[DEBUG] Reading file model from org.apache.commons:commons-parent:73
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] Merging repositories from org.apache.maven:maven-parent:pom:26
    maven-default-http-blocker (http://0.0.0.0/, default, snapshots, blocked)
central (https://repo.maven.apache.org/maven2, default, releases)
[DEBUG] Merging repositories from org.apache.maven:maven-parent:pom:42
    central (https://repo.maven.apache.org/maven2, default, releases)
apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)
[DEBUG] Merging repositories from org.apache.maven:maven-parent:pom:42
    central (https://repo.maven.apache.org/maven2, default, releases)
apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)
[DEBUG] Reading file model from org.apache:apache:32
[DEBUG] Reading file model from org.apache:apache:16
[DEBUG] Reading file model from org.apache:apache:33
[DEBUG] [2][close] Waiting for 1 active tasks to complete.
[DEBUG] Replacing repositories from org.apache.maven:maven:pom:3.3.1
    maven-default-http-blocker (http://0.0.0.0/, default, snapshots, blocked)
    central (https://repo.maven.apache.org/maven2, default, releases)
[DEBUG] Replacing repositories from org.apache.maven.shared:maven-dependency-tree:jar:3.3.0
    central (https://repo.maven.apache.org/maven2, default, releases)
    apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)
[DEBUG] Replacing repositories from org.apache.maven.shared:maven-dependency-analyzer:jar:1.14.1
    central (https://repo.maven.apache.org/maven2, default, releases)
    apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)
[DEBUG] Reading file model from org.codehaus.plexus:plexus-utils:3.0.24
[DEBUG] Reading file model from org.junit:junit-bom:5.10.2
[DEBUG] Replacing repositories from commons-codec:commons-codec:jar:1.17.1
    central (https://repo.maven.apache.org/maven2, default, releases)
    apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)
[DEBUG] Replacing repositories from org.apache.commons:commons-lang3:jar:3.17.0
    central (https://repo.maven.apache.org/maven2, default, releases)
    apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)
[DEBUG] Reading file model from org.junit:junit-bom:5.11.0-M2
...

These are multiple different versions of JUnit I didn't specify in my (reproducer) POM.

@sbrannen
Copy link
Collaborator

When I changed the version in my local ~/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.10.6/junit-platform-native-0.10.6.pom to the following (I changed the versions of junit-bom, junit-platform-console and junit-platform-launcher) and recalculated the sha1 hash, I got a different stack trace:

Indeed, you get a different stack trace there.

The reason is that junit-platform-commons is still an old version that is pulled in by the native-build-tools Maven plugin, and that is incompatible with the JUnit Platform version needed by JUnit Jupiter 5.12.1.

Specifying the junit-jupiter aggregator artifact (which pulls in junit-jupiter-engine as well) plus the junit-platform-launcher artifact results in the JUnit versions you specified (or rather imported via the junit-bom) being placed first on the class path for the native-image executable, and your native tests then work.

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.junit</groupId>
			<artifactId>junit-bom</artifactId>
			<version>5.12.1</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<dependencies>
	<dependency>
		<groupId>org.junit.jupiter</groupId>
		<artifactId>junit-jupiter</artifactId>
	</dependency>
	<dependency>
		<groupId>org.junit.platform</groupId>
		<artifactId>junit-platform-launcher</artifactId>
	</dependency>
</dependencies>

I tried the above with your original reproducer, and that works for me! 👍

Running Maven with -X shows the following class path for the native-image executable.

[INFO] Executing: /opt/graalvm/graalvm-jdk-21.0.4+8.1/Contents/Home/bin/native-image -cp /Users/sbrannen/source/native-build-tools-issues/junit-feature-failure/target/test-classes:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter/5.12.1/junit-jupiter-5.12.1.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.12.1/junit-jupiter-api-5.12.1.jar:/Users/sbrannen/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-commons/1.12.1/junit-platform-commons-1.12.1.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.12.1/junit-jupiter-params-5.12.1.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.12.1/junit-jupiter-engine-5.12.1.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-launcher/1.12.1/junit-platform-launcher-1.12.1.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-engine/1.12.1/junit-platform-engine-1.12.1.jar:/Users/sbrannen/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/sbrannen/.m2/repository/org/graalvm/buildtools/native-maven-plugin/0.10.6/native-maven-plugin-0.10.6.jar:/Users/sbrannen/.m2/repository/org/graalvm/buildtools/utils/0.10.6/utils-0.10.6.jar:/Users/sbrannen/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.10.6/graalvm-reachability-metadata-0.10.6.jar:/Users/sbrannen/.m2/repository/org/graalvm/buildtools/junit-platform-native/0.10.6/junit-platform-native-0.10.6.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-console/1.10.0/junit-platform-console-1.10.0.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-reporting/1.10.0/junit-platform-reporting-1.10.0.jar:/Users/sbrannen/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.0/junit-platform-launcher-1.10.0.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-engine/1.10.0/junit-platform-engine-1.10.0.jar:/Users/sbrannen/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/sbrannen/.m2/repository/org/junit/platform/junit-platform-commons/1.10.0/junit-platform-commons-1.10.0.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.0/junit-jupiter-5.10.0.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.0/junit-jupiter-api-5.10.0.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.0/junit-jupiter-params-5.10.0.jar:/Users/sbrannen/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.0/junit-jupiter-engine-5.10.0.jar --no-fallback -o /Users/sbrannen/source/native-build-tools-issues/junit-feature-failure/target/native-tests -Djunit.platform.listeners.uid.tracking.output.dir=/Users/sbrannen/source/native-build-tools-issues/junit-feature-failure/target/test-ids -H:+ReportExceptionStackTraces --features=org.graalvm.junit.platform.JUnitPlatformFeature org.graalvm.junit.platform.NativeImageJUnitLauncher

From that you can see that the appropriate JUnit 5.12.1/1.12.1 artifacts (that you requested) are on the class path before the JUnit 5.10.0/1.10.0 artifacts (hard coded in the plugin).

In other words, if you override all artifacts that the plugin adds to the classpath, you effectively have a workaround for this issue.

In light of the above, I am closing this as a:

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2025
@sbrannen sbrannen added the duplicate This issue or pull request already exists label Mar 17, 2025
@sbrannen sbrannen changed the title Overridden test method: JUnitPlatformFeature unexpectedly failed with a(n) org.junit.platform.commons.JUnitException JUnitPlatformFeature unexpectedly failed with a JUnitException Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists junit-support Related to JUnit Support project
Projects
None yet
Development

No branches or pull requests

6 participants