This repository was archived by the owner on Dec 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
This repository was archived by the owner on Dec 3, 2023. It is now read-only.
Native Image build is failing when the Category annotation is used in tests #731
Copy link
Copy link
Closed
Labels
api: spannerIssues related to the Cloud Spanner API.Issues related to the Cloud Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.
Description
Tests in the java-spanner projects used the Category annotation, which results in the following error when the native image is being built:
org.junit.platform.engine.TestTag was unintentionally initialized at build time. org.junit.platform.engine.TestTag caused initialization of this class with the following trace:
at org.junit.platform.engine.TestTag.<clinit>(TestTag.java:54)
at org.junit.platform.engine.TestTag.<clinit>(TestTag.java:54)
at org.junit.vintage.engine.descriptor.VintageTestDescriptor$$Lambda$656/0x00000007c23d8440.apply(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
...
at org.junit.platform.engine.TestDescriptor.lambda$accept$0(TestDescriptor.java:251)
at org.junit.platform.engine.TestDescriptor$$Lambda$639/0x00000007c23d4040.accept(Unknown Source)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:251)
at org.junit.platform.launcher.TestPlan.lambda$from$1(TestPlan.java:95)
at org.junit.platform.launcher.TestPlan$$Lambda$649/0x00000007c23d6840.accept(Unknown Source)
at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608)
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
at org.junit.platform.launcher.TestPlan.from(TestPlan.java:95)
at org.junit.platform.launcher.core.InternalTestPlan.from(InternalTestPlan.java:32)
at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:78)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.discover(DefaultLauncherSession.java:81)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:46)
at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:135)
It looks like the failure occurs when VintageTestDescriptor calls the TestTag object which is not recognized by the native image builder.
Reproducer: https://github.com/mpeddada1/junit-experiment
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Cloud Spanner API.Issues related to the Cloud Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.