Closed edeandrea closed 9 months ago
I did re-run using the --trace-class-initialization=org.springframework.core.NativeDetector,org.springframework.aot.AotDetector
and this is what it showed:
Error: Classes that should be initialized at run time got initialized during image building:
org.springframework.aot.AotDetector was unintentionally initialized at build time. org.springframework.aot.AotDetector caused initialization of this class with the following trace:
at org.springframework.aot.AotDetector.<clinit>(AotDetector.java:42)
at java.lang.Class.forName0(Unknown Source)
at java.lang.Class.forName(Class.java:375)
at org.graalvm.junit.platform.config.jupiter.JupiterConfigProvider.handleMethodReference(JupiterConfigProvider.java:157)
at org.graalvm.junit.platform.config.jupiter.JupiterConfigProvider.handleDisabledIf(JupiterConfigProvider.java:141)
at org.graalvm.junit.platform.config.jupiter.JupiterConfigProvider$$Lambda$913/0x0000007003d03680.apply(Unknown Source)
at org.graalvm.junit.platform.config.util.AnnotationUtils.lambda$registerClassesFromAnnotationForReflection$3(AnnotationUtils.java:117)
at org.graalvm.junit.platform.config.util.AnnotationUtils$$Lambda$902/0x0000007003d01b40.accept(Unknown Source)
at org.graalvm.junit.platform.config.util.AnnotationUtils.forEachAnnotationOnClassMembers(AnnotationUtils.java:63)
at org.graalvm.junit.platform.config.util.AnnotationUtils.registerClassesFromAnnotationForReflection(AnnotationUtils.java:116)
at org.graalvm.junit.platform.config.jupiter.JupiterConfigProvider.onTestClassRegistered(JupiterConfigProvider.java:129)
at org.graalvm.junit.platform.JUnitPlatformFeature.lambda$registerTestClassForReflection$3(JUnitPlatformFeature.java:153)
at org.graalvm.junit.platform.JUnitPlatformFeature$$Lambda$897/0x0000007003d00fe8.accept(Unknown Source)
at org.graalvm.junit.platform.JUnitPlatformFeature.forEachProvider(JUnitPlatformFeature.java:162)
at org.graalvm.junit.platform.JUnitPlatformFeature.registerTestClassForReflection(JUnitPlatformFeature.java:153)
at org.graalvm.junit.platform.JUnitPlatformFeature$$Lambda$896/0x0000007003d00db0.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
at java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.graalvm.junit.platform.JUnitPlatformFeature.discoverTestsAndRegisterTestClassesForReflection(JUnitPlatformFeature.java:145)
at org.graalvm.junit.platform.JUnitPlatformFeature.beforeAnalysis(JUnitPlatformFeature.java:94)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$9(NativeImageGenerator.java:757)
at com.oracle.svm.hosted.NativeImageGenerator$$Lambda$578/0x0000007003cc8718.accept(Unknown Source)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:89)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:757)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:582)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:539)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:408)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:612)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:134)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
org.springframework.core.NativeDetector was unintentionally initialized at build time. org.springframework.aot.AotDetector caused initialization of this class with the following trace:
at org.springframework.core.NativeDetector.<clinit>(NativeDetector.java:31)
at org.springframework.aot.AotDetector.<clinit>(AotDetector.java:42)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
I'm not sure if this is related, but I did have a test that was annotated with @org.junit.jupiter.api.condition.DisabledInNativeImage
previously in Spring Boot 3.1.5. During the 3.2.0 upgrade that stopped working. The test was getting run even though it shouldn't be, & subsequently failing with the following.
I changed it to use @org.springframework.test.context.aot.DisabledInAotMode
instead. That fixed the test from trying to run but then introduced this issue.
Exception in thread "main" org.springframework.test.context.aot.TestContextAotException: Failed to generate AOT artifacts for test classes [com.redhat.springmusic.api.OutboxEventsApiTests]
at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:285)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at org.springframework.util.MultiValueMapAdapter.forEach(MultiValueMapAdapter.java:179)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:243)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:205)
at org.springframework.test.context.aot.TestAotProcessor.performAotProcessing(TestAotProcessor.java:91)
at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:72)
at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:39)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
at org.springframework.boot.test.context.SpringBootTestAotProcessor.main(SpringBootTestAotProcessor.java:63)
Caused by: org.springframework.test.context.aot.TestContextAotException: Failed to process test class [com.redhat.springmusic.api.OutboxEventsApiTests] for AOT
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:322)
at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:276)
... 9 more
Caused by: java.lang.IllegalArgumentException: Failed to generate code for '[[MockDefinition@50b78155 name = '', typeToMock = com.redhat.springmusic.service.OutboxEventService, extraInterfaces = set[[empty]], answer = RETURNS_DEFAULTS, serializable = false, reset = AFTER]]' with type java.util.LinkedHashSet<?>
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:105)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.generateValue(BeanDefinitionPropertiesCodeGenerator.java:257)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.lambda$addConstructorArgumentValues$3(BeanDefinitionPropertiesCodeGenerator.java:179)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1553)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.addConstructorArgumentValues(BeanDefinitionPropertiesCodeGenerator.java:176)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.generateCode(BeanDefinitionPropertiesCodeGenerator.java:126)
at org.springframework.beans.factory.aot.DefaultBeanRegistrationCodeFragments.generateSetBeanDefinitionPropertiesCode(DefaultBeanRegistrationCodeFragments.java:176)
at org.springframework.beans.factory.aot.BeanRegistrationCodeGenerator.generateCode(BeanRegistrationCodeGenerator.java:81)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.lambda$generateBeanDefinitionMethod$3(BeanDefinitionMethodGenerator.java:176)
at org.springframework.aot.generate.GeneratedMethod.<init>(GeneratedMethod.java:54)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:112)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:89)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:169)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:89)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$generateRegisterBeanDefinitionsMethod$2(BeanRegistrationsAotContribution.java:90)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.generateRegisterBeanDefinitionsMethod(BeanRegistrationsAotContribution.java:88)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$applyTo$1(BeanRegistrationsAotContribution.java:73)
at org.springframework.aot.generate.GeneratedMethod.<init>(GeneratedMethod.java:54)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:112)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:89)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.applyTo(BeanRegistrationsAotContribution.java:72)
at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:78)
at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:318)
... 10 more
Caused by: java.lang.IllegalArgumentException: Failed to generate code for '[MockDefinition@50b78155 name = '', typeToMock = com.redhat.springmusic.service.OutboxEventService, extraInterfaces = set[[empty]], answer = RETURNS_DEFAULTS, serializable = false, reset = AFTER]' with type ?
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCodeForElement(BeanDefinitionPropertyValueCodeGenerator.java:114)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$CollectionDelegate.generateCollectionOf(BeanDefinitionPropertyValueCodeGenerator.java:351)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$SetDelegate.generateCollectionCode(BeanDefinitionPropertyValueCodeGenerator.java:450)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$SetDelegate.generateCollectionCode(BeanDefinitionPropertyValueCodeGenerator.java:440)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$CollectionDelegate.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:334)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:132)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:102)
... 37 more
Caused by: java.lang.IllegalArgumentException: Code generation does not support ?
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:137)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCodeForElement(BeanDefinitionPropertyValueCodeGenerator.java:111)
... 43 more
Hello 👋 ,
It might be related, I have the exact problem even without Native, just for AOT code for standard JVM (which is the same, but then it's not purely native related 😇).
The stack trace is:
> Task :build-plugin-docker-images:checkKotlinGradlePluginConfigurationErrors
> Task :build-plugin-database:checkKotlinGradlePluginConfigurationErrors
> Task :build-plugin-database:compileKotlin UP-TO-DATE
> Task :build-plugin-docker-images:compileKotlin UP-TO-DATE
> Task :build-plugin-docker-images:compileJava NO-SOURCE
> Task :build-plugin-database:compileJava NO-SOURCE
> Task :build-plugin-database:pluginDescriptors UP-TO-DATE
> Task :build-plugin-docker-images:pluginDescriptors UP-TO-DATE
> Task :build-plugin-database:processResources UP-TO-DATE
> Task :build-plugin-docker-images:processResources UP-TO-DATE
> Task :build-plugin-database:classes UP-TO-DATE
> Task :build-plugin-docker-images:classes UP-TO-DATE
> Task :build-plugin-database:jar UP-TO-DATE
> Task :build-plugin-docker-images:jar UP-TO-DATE
> Task :backend:checkKotlinGradlePluginConfigurationErrors
> Task :backend-lib-database:compileJava UP-TO-DATE
> Task :backend-lib-database:processResources NO-SOURCE
> Task :backend-lib-database:classes UP-TO-DATE
> Task :backend-lib-database:jar UP-TO-DATE
> Task :backend-lib-youtubedl:compileJava UP-TO-DATE
> Task :backend-lib-youtubedl:processResources NO-SOURCE
> Task :backend-lib-youtubedl:classes UP-TO-DATE
> Task :backend-lib-youtubedl:jar UP-TO-DATE
> Task :backend:generateGitProperties
> Task :backend:processResources UP-TO-DATE
> Task :backend:processTestResources UP-TO-DATE
> Task :backend:koverFindJar
> Task :backend-lib-database:flywayMigrate
> Task :backend:compileKotlin
> Task :backend:compileJava NO-SOURCE
> Task :backend:classes
> Task :backend:compileTestKotlin
> Task :backend:compileTestJava NO-SOURCE
> Task :backend:testClasses UP-TO-DATE
> Task :backend:processTestAot
2023-11-27T17:26:58.004+01:00 INFO 66018 --- [ main] c.g.d.p.PodcastServerApplicationTests : Starting PodcastServerApplicationTests using Java 21.0.1 with PID 66018 (/Users/kdavin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/build/classes/kotlin/test started by kdavin in /Users/kdavin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend)
2023-11-27T17:26:58.006+01:00 INFO 66018 --- [ main] c.g.d.p.PodcastServerApplicationTests : No active profile set, falling back to 1 default profile: "default"
2023-11-27T17:26:59.277+01:00 INFO 66018 --- [ main] c.g.d.p.cover.CoverHandlerTest : Starting CoverHandlerTest using Java 21.0.1 with PID 66018 (/Users/kdavin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/build/classes/kotlin/test started by kdavin in /Users/kdavin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend)
2023-11-27T17:26:59.278+01:00 INFO 66018 --- [ main] c.g.d.p.cover.CoverHandlerTest : No active profile set, falling back to 1 default profile: "default"
WARNING: A Java agent has been loaded dynamically (/Users/kdavin/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.14.10/90ed94ac044ea8953b224304c762316e91fd6b31/byte-buddy-agent-1.14.10.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
Exception in thread "main" org.springframework.test.context.aot.TestContextAotException: Failed to generate AOT artifacts for test classes [com.github.davinkevin.podcastserver.cover.CoverHandlerTest]
at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:285)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
at org.springframework.util.MultiValueMapAdapter.forEach(MultiValueMapAdapter.java:179)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:243)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:205)
at org.springframework.test.context.aot.TestAotProcessor.performAotProcessing(TestAotProcessor.java:91)
at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:72)
at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:39)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
at org.springframework.boot.test.context.SpringBootTestAotProcessor.main(SpringBootTestAotProcessor.java:63)
Caused by: org.springframework.test.context.aot.TestContextAotException: Failed to process test class [com.github.davinkevin.podcastserver.cover.CoverHandlerTest] for AOT
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:322)
at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:276)
... 9 more
Caused by: java.lang.IllegalArgumentException: Failed to generate code for '[[MockDefinition@354ff4f6 name = '', typeToMock = com.github.davinkevin.podcastserver.cover.CoverService, extraInterfaces = set[[empty]], answer = RETURNS_DEFAULTS, serializable = false, reset = AFTER]]' with type java.util.LinkedHashSet<?>
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:105)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.generateValue(BeanDefinitionPropertiesCodeGenerator.java:257)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.lambda$addConstructorArgumentValues$3(BeanDefinitionPropertiesCodeGenerator.java:179)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1707)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.addConstructorArgumentValues(BeanDefinitionPropertiesCodeGenerator.java:176)
at org.springframework.beans.factory.aot.BeanDefinitionPropertiesCodeGenerator.generateCode(BeanDefinitionPropertiesCodeGenerator.java:126)
at org.springframework.beans.factory.aot.DefaultBeanRegistrationCodeFragments.generateSetBeanDefinitionPropertiesCode(DefaultBeanRegistrationCodeFragments.java:176)
at org.springframework.beans.factory.aot.BeanRegistrationCodeGenerator.generateCode(BeanRegistrationCodeGenerator.java:81)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.lambda$generateBeanDefinitionMethod$3(BeanDefinitionMethodGenerator.java:176)
at org.springframework.aot.generate.GeneratedMethod.<init>(GeneratedMethod.java:54)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:112)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:89)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:169)
at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:89)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$generateRegisterBeanDefinitionsMethod$2(BeanRegistrationsAotContribution.java:90)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.generateRegisterBeanDefinitionsMethod(BeanRegistrationsAotContribution.java:88)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$applyTo$1(BeanRegistrationsAotContribution.java:73)
at org.springframework.aot.generate.GeneratedMethod.<init>(GeneratedMethod.java:54)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:112)
at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:89)
at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.applyTo(BeanRegistrationsAotContribution.java:72)
at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:78)
at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:318)
... 10 more
Caused by: java.lang.IllegalArgumentException: Failed to generate code for '[MockDefinition@354ff4f6 name = '', typeToMock = com.github.davinkevin.podcastserver.cover.CoverService, extraInterfaces = set[[empty]], answer = RETURNS_DEFAULTS, serializable = false, reset = AFTER]' with type ?
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCodeForElement(BeanDefinitionPropertyValueCodeGenerator.java:114)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$CollectionDelegate.generateCollectionOf(BeanDefinitionPropertyValueCodeGenerator.java:351)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$SetDelegate.generateCollectionCode(BeanDefinitionPropertyValueCodeGenerator.java:450)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$SetDelegate.generateCollectionCode(BeanDefinitionPropertyValueCodeGenerator.java:440)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator$CollectionDelegate.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:334)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:132)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:102)
... 37 more
Caused by: java.lang.IllegalArgumentException: Code generation does not support ?
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCode(BeanDefinitionPropertyValueCodeGenerator.java:137)
at org.springframework.beans.factory.aot.BeanDefinitionPropertyValueCodeGenerator.generateCodeForElement(BeanDefinitionPropertyValueCodeGenerator.java:111)
... 43 more
> Task :backend:processTestAot FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backend:processTestAot'.
> Process 'command '/Users/kdavin/.asdf/installs/java/graalvm-community-21.0.1/bin/java'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 19s
23 actionable tasks: 9 executed, 14 up-to-date
The complete project is available on GitLab.
@davinkevin this is unrelated. Please create a separate Spring Framework issue with instructions to reproduce.
@davinkevin That's a separate problem. @MockBean
and @SpyBean
are not yet supported with AOT or Native. https://github.com/spring-projects/spring-boot/issues/32195 is tracking that effort.
@wilkinsona but it was working in 3.1.x 🤔. I did not change the code, just the dependency
I suspect it wasn't fully working in 3.1.x. Spring Framework 6.0 would log failures during AOT processing of tests and they would only become apparent when the tests were run. This was changed in Framework 6.1 to fail fast during AOT processing with @DisabledInAotMode
introduced to disable the test. You should be able to use it fine now if you're not targeting a native image.
I suspect it wasn't fully working in 3.1.x. Spring Framework 6.0 would log failures during AOT processing of tests and they would only become apparent when the tests were run. This was changed in Framework 6.1 to fail fast during AOT processing with
@DisabledInAotMode
introduced to disable the test. You should be able to use it fine now if you're not targeting a native image.
I assume your comment is intended for @davinkevin?
In my case, I am using @DisabledInAotMode
(although I wasn't in 3.1.5 - I was using @DisabledInNativeImage
, but that doesn't seem to work anymore in 3.2.0).
I suspect it wasn't fully working in 3.1.x. Spring Framework 6.0 would log failures during AOT processing of tests and they would only become apparent when the tests were run. This was changed in Framework 6.1 to fail fast during AOT processing with
@DisabledInAotMode
introduced to disable the test. You should be able to use it fine now if you're not targeting a native image.
processTestAot
and test
were fine, no problem for them… running with standard java. (I use AOT to speed up startup, not for native). I'll give a try to this annotation, thanks.
Looking at the summit-lab-spring-music
project: When building it with Boot 3.1, I see this in the logs:
2023-11-28T13:38:05.304+01:00 WARN 26093 --- [ main] o.s.t.c.aot.TestContextAotGenerator : Failed to generate AOT artifacts for test classes [com.redhat.springmusic.api.OutboxEventsApiTests]. Enable DEBUG logging to view the stack trace. org.springframework.test.context.aot.TestContextAotException: Failed to process test class [com.redhat.springmusic.api.OutboxEventsApiTests] for AOT
This was a WARN log message in 3.1 and is now failing the build in 3.2 and this is what @wilkinsona is referring to. @DisabledInNativeImage
generally works.
The problem here is that @DisabledInAotMode
doesn't work in a native image. I have a minimal reproducer here:
sb-38569.zip
@DisabledInNativeImage generally works.
But it is not working here. In boot 3.1.x, @DisabledInNativeImage
prevented the test class from running, like it was supposed to do. In boot 3.2.0, @DisabledInNativeImage
is no longer working. The test class executes even though it shouldn't.
In 3.1.x, AOT processing for that class failed, which was logged, and then the process moved on. Native image then found @DisabledInNativeImage
and ignored the test.
In 3.2.x, AOT processing for that class fails, which breaks the build. The native image never sees the @DisabledInNativeImage
on the test class, as the build is stopped before.
Ahhh ok - so what you're saying is that @DisabledInNativeImage
was never actually working properly :)
Nevermind my previous comment @mhalbritter - I wrote it before you adjusted your previous comment, which is much more clear.
Hello 👋,
I see the issue is now closed (good 👍), but I feel my case won't be covered from the commit code I've read.
Is there any solution:
ATM, I have this stack trace:
2023-12-02T15:05:45.467+01:00 INFO 17850 --- [ main] c.g.d.p.PodcastServerApplicationTests : Starting PodcastServerApplicationTests using Java 21.0.1 with PID 17850 (/Users/kdavin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/build/classes/kotlin/test started by kdavin in /Users/kdavin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend)
2023-12-02T15:05:45.468+01:00 INFO 17850 --- [ main] c.g.d.p.PodcastServerApplicationTests : No active profile set, falling back to 1 default profile: "default"
Exception in thread "main" org.springframework.test.context.aot.TestContextAotException: All test classes that share an ApplicationContext must be annotated with @DisabledInAotMode if one of them is: [com.github.davinkevin.podcastserver.cover.CoverHandlerTest$ShouldDeleteCover, com.github.davinkevin.podcastserver.cover.CoverRepositoryTest$ShouldFindCoverOlderThan, com.github.davinkevin.podcastserver.cover.CoverRepositoryTest$ShouldSaveCover, com.github.davinkevin.podcastserver.cover.CoverServiceTest$ShouldDeleteOldCovers, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldDownloadItem, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldFindLimitNumberOfParallelDownloads, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldMoveInQueue, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldProvideDownloadingList, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldProvideWaitingQueue, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldRemoveFromQueue, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldStopAllDownloads, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldStopOneDownload, com.github.davinkevin.podcastserver.download.DownloadHandlerTest$ShouldUpdateLimitNumberOfParallelDownloads, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldAddItemToQueue, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldAddItemToQueue$WithSuccess, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldFindAllDownloading, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldFindAllToDownload, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldFindAllToDownload$WithItemAlreadyDownloading, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldFindAllToDownload$WithNoItemCurrentlyDownloading, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldFindAllWaiting, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldFinishDownload, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldInitQueue, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldInitQueue$WithItems, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldInitQueue$WithItems$AndFilterOnDate, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldInitQueue$WithItems$AndFilterOnRetry, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldMoveIntoQueue, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldMoveIntoQueue$WithItemsInDownloadingItemsTable, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldRemoveFromQueue, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldStartItem, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldStopItem, com.github.davinkevin.podcastserver.download.DownloadRepositoryTest$ShouldUpdateDownloadItem, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldAddItemToQueue, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldExposeDownloadingQueue, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldExposeWaitingQueue, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldLaunchDownload, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldMoveIntoQueue, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldProvideIfIsInDownloadingQueue, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldRemoveItemFromDownloading, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldRemoveItemFromQueue, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldRemoveItemFromQueueAndDownloading, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldStopAllDownload, com.github.davinkevin.podcastserver.download.ItemDownloadManagerTest$ShouldUseLimitParallelDownload, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlDownloaderTest$Compatibility, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlDownloaderTest$ShouldDownload, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlDownloaderTest$ShouldDownload$AndBroadcast, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlDownloaderTest$ShouldDownload$ButFailsDueToError, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlDownloaderTest$ShouldDownload$ButFailsDueToError$DuringDownload, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlDownloaderTest$ShouldDownload$ButFailsDueToError$DuringFinishOfDownload, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlServiceTest$ShouldDownload, com.github.davinkevin.podcastserver.download.downloaders.youtubedl.YoutubeDlServiceTest$ShouldExtractName, com.github.davinkevin.podcastserver.find.FindHandlerTest$ShouldFind, com.github.davinkevin.podcastserver.find.finders.dailymotion.DailymotionFinderTest$ShouldFind, com.github.davinkevin.podcastserver.find.finders.dailymotion.DailymotionFinderTest$ShouldFind$WithError, com.github.davinkevin.podcastserver.find.finders.dailymotion.DailymotionFinderTest$ShouldFind$WithSuccess, com.github.davinkevin.podcastserver.find.finders.francetv.FranceTvFinderTest$ShouldFind, com.github.davinkevin.podcastserver.find.finders.gulli.GulliFinderTest$ShouldFind, com.github.davinkevin.podcastserver.find.finders.mytf1.MyTf1FinderTest$OnCompatibility, com.github.davinkevin.podcastserver.find.finders.mytf1.MyTf1FinderTest$ShouldFind, com.github.davinkevin.podcastserver.find.finders.mytf1.MyTf1FinderTest$ShouldFind$InformationWithCover, com.github.davinkevin.podcastserver.find.finders.rss.RSSFinderTest$ShouldBeCompatible, com.github.davinkevin.podcastserver.find.finders.rss.RSSFinderTest$ShouldFind, com.github.davinkevin.podcastserver.find.finders.youtube.YoutubeFinderTest$ShouldFind, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldDelete, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldDeleteItem, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldFindById, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldFindItemsOfPodcast, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldFindWatchListsAssociatedToAnItem, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldReset, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldSearchForItem, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldSearchForItem$OnParameters, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldSearchForItem$WithSuccess, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldServeCover, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldServeFile, com.github.davinkevin.podcastserver.item.ItemHandlerTest$ShouldUpload, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$HasToBeDeleted, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldCreate, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldCreate$ASingleItem, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldCreate$ASingleItem$WithError, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldCreate$ASingleItem$WithSuccess, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldCreate$MultipleItems, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldCreate$MultipleItems$WithSuccess, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldDelete, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldDelete$ById, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldFindAll, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldFindAllPlaylistsContainingAnItemById, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldFindById, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldFindItemInDownloadingState, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldReset, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$OnQueryParameter, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithNoTagsAndNoStatutes, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithNoTagsAndStatusNotDownloaded, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithPodcastId, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithSpecificOrder, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithTagsT1AndNoSpecificStatutes, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithTagsT1AndT2AndNoSpecificStatutes, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldSearchWithPagination$WithTagsT3AndNoSpecificStatutes, com.github.davinkevin.podcastserver.item.ItemRepositoryTest$ShouldUpdateAsDeleted, com.github.davinkevin.podcastserver.item.ItemServiceTest$ShouldDeleteById, com.github.davinkevin.podcastserver.item.ItemServiceTest$ShouldFindAllPlaylistsContainingAnItemById, com.github.davinkevin.podcastserver.item.ItemServiceTest$ShouldReset, com.github.davinkevin.podcastserver.item.ItemServiceTest$ShouldSearch, com.github.davinkevin.podcastserver.item.ItemServiceTest$ShouldUploadFile, com.github.davinkevin.podcastserver.messaging.MessageHandlerTest$OnStreamingToClient, com.github.davinkevin.podcastserver.messaging.MessageHandlerTest$OnStreamingToClient$OnDownloadingItem, com.github.davinkevin.podcastserver.messaging.MessageHandlerTest$OnStreamingToClient$OnUpdate, com.github.davinkevin.podcastserver.messaging.MessageHandlerTest$OnStreamingToClient$OnWaitingListChange, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldAdd, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldDelete, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldFindAll, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldFindById, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldFindById$AsJson, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldFindById$AsRss, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldRemove, com.github.davinkevin.podcastserver.playlist.PlaylistHandlerTest$ShouldSave, com.github.davinkevin.podcastserver.playlist.PlaylistRepositoryTest$ShouldAdd, com.github.davinkevin.podcastserver.playlist.PlaylistRepositoryTest$ShouldDelete, com.github.davinkevin.podcastserver.playlist.PlaylistRepositoryTest$ShouldFindAll, com.github.davinkevin.podcastserver.playlist.PlaylistRepositoryTest$ShouldFindById, com.github.davinkevin.podcastserver.playlist.PlaylistRepositoryTest$ShouldRemove, com.github.davinkevin.podcastserver.playlist.PlaylistRepositoryTest$ShouldSave, com.github.davinkevin.podcastserver.playlist.PlaylistServiceTest$ShouldAdd, com.github.davinkevin.podcastserver.playlist.PlaylistServiceTest$ShouldDelete, com.github.davinkevin.podcastserver.playlist.PlaylistServiceTest$ShouldFindAll, com.github.davinkevin.podcastserver.playlist.PlaylistServiceTest$ShouldFindById, com.github.davinkevin.podcastserver.playlist.PlaylistServiceTest$ShouldRemove, com.github.davinkevin.podcastserver.playlist.PlaylistServiceTest$ShouldSave, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldCreate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldDelete, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindAll, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindCover, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$ForAGivenPodcast, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$ForAGivenPodcast$ByCreationDate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$ForAGivenPodcast$ByDownloadDate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$ForAGivenPodcast$ByPubDate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$Globally, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$Globally$ByCreationDate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$Globally$ByDownloadDate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldFindStats$Globally$ByPubDate, com.github.davinkevin.podcastserver.podcast.PodcastHandlerTest$ShouldUpdate, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldDelete, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldFindAll, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldFindById, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldFindStats, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldFindStats$ByPodcast, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldFindStats$Globally, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldSave, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldSave$ANewPodcast, com.github.davinkevin.podcastserver.podcast.PodcastRepositoryTest$ShouldUpdate, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldDelete, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldFindAll, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldFindStats, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldFindStats$ByPodcastId, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldFindStats$Globally, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldSavePodcast, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldSavePodcast$WhichDoesntExistBefore, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldUpdatePodcast, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldUpdatePodcast$WithModificationOnCover, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldUpdatePodcast$WithModificationOnTags, com.github.davinkevin.podcastserver.podcast.PodcastServiceTest$ShouldUpdatePodcast$WithModificationOnTitle, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateOPML, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateOPML$WithVariableHeaderConfigurationAsHost, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateOPML$WithVariableHeaderConfigurationAsHost$OnHost, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateOPML$WithVariableHeaderConfigurationAsHost$OnPort, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateOPML$WithVariableHeaderConfigurationAsHost$OnScheme, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateRss, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateRss$ForPodcastWithBooleanLimit, com.github.davinkevin.podcastserver.podcast.PodcastXmlHandlerTest$ShouldGenerateRss$ForPodcastWithIntegerLimit, com.github.davinkevin.podcastserver.podcast.type.TypeHandlerTest$ShouldFindAll, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldCache, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldCheckIfCoverExists, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldCheckIfCoverExists$ForItem, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldCheckIfCoverExists$ForPodcast, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldDeleteCover, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldDeleteItemFile, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldDeletePodcast, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldDownloadCover, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldDownloadCover$ForItem, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldDownloadCover$ForPodcast, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldFetchMetadata, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldInitBucket, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldMovePodcastDetails, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldSignUrl, com.github.davinkevin.podcastserver.service.storage.FileStorageServiceTest$ShouldUploadFile, com.github.davinkevin.podcastserver.tag.TagHandlerTest$ShouldFindById, com.github.davinkevin.podcastserver.tag.TagHandlerTest$ShouldFindByNameContaining, com.github.davinkevin.podcastserver.tag.TagRepositoryTest$ShouldFindById, com.github.davinkevin.podcastserver.tag.TagRepositoryTest$ShouldFindByNameLike, com.github.davinkevin.podcastserver.tag.TagRepositoryTest$ShouldSave, com.github.davinkevin.podcastserver.tag.TagServiceTest$ShouldFindById, com.github.davinkevin.podcastserver.tag.TagServiceTest$ShouldFindByName, com.github.davinkevin.podcastserver.update.UpdateHandlerTest$ShouldUpdateAll, com.github.davinkevin.podcastserver.update.UpdateHandlerTest$ShouldUpdatePodcast, com.github.davinkevin.podcastserver.update.updaters.dailymotion.DailymotionUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.dailymotion.DailymotionUpdaterTest$ShouldFindItems, com.github.davinkevin.podcastserver.update.updaters.dailymotion.DailymotionUpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.francetv.FranceTvUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.francetv.FranceTvUpdaterTest$ShouldFindItems, com.github.davinkevin.podcastserver.update.updaters.francetv.FranceTvUpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.gulli.GulliUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.gulli.GulliUpdaterTest$ShouldFindItems, com.github.davinkevin.podcastserver.update.updaters.gulli.GulliUpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.mytf1.MyTf1UpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.mytf1.MyTf1UpdaterTest$ShouldFindItems, com.github.davinkevin.podcastserver.update.updaters.mytf1.MyTf1UpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.rss.RSSUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.rss.RSSUpdaterTest$ShouldFindItems, com.github.davinkevin.podcastserver.update.updaters.rss.RSSUpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.upload.UploadUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByApiUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByApiUpdaterTest$ShouldFindItems, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByApiUpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$Compatibility, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$ShouldFind, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$ShouldFind$InAChannel, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$ShouldFind$InAPlaylist, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$ShouldSign, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$ShouldSign$AChannel, com.github.davinkevin.podcastserver.update.updaters.youtube.YoutubeByXmlUpdaterTest$ShouldSign$APlaylist]
at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:253)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
at org.springframework.util.MultiValueMapAdapter.forEach(MultiValueMapAdapter.java:179)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:243)
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:205)
at org.springframework.test.context.aot.TestAotProcessor.performAotProcessing(TestAotProcessor.java:91)
at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:72)
at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:39)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
at org.springframework.boot.test.context.SpringBootTestAotProcessor.main(SpringBootTestAotProcessor.java:63)
> Task :backend:processTestAot FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backend:processTestAot'.
> Process 'command '/Users/kdavin/.asdf/installs/java/graalvm-community-21.0.1/bin/java'' finished with non-zero exit value 1
And I feel adding @DisabledInAotMode will reduce the number of test run and potentially doesn't mean anything for my case.
Finally, should I open an new issue @wilkinsona?
@davinkevin Running test with AOT is supported, but not for unsupported use cases like @Mockbean
or @Spybean
as mentioned by Andy in his comment.
I am not sure a new issue is needed (unless you have found another broken use case with AOT tests) but https://github.com/spring-projects/spring-boot/issues/32195 title is indeed confusing, I have dropped this comment on Spring Boot side to clarify.
I have an application that runs
./mvnw clean verify -PnativeTest
. It has been running fine on Spring Boot 3.1.5. Today I upgraded it to 3.2.0 and that same test is now failing. This is my current environment:The application can be found at https://github.com/edeandrea/summit-lab-spring-music. The PR that is failing is at https://github.com/edeandrea/summit-lab-spring-music/pull/15.
This is the error I'm getting:
This is an abridged log (the whole thing can be seen on https://github.com/edeandrea/summit-lab-spring-music/actions/runs/7007454530/job/19061577893?pr=15):