-
Notifications
You must be signed in to change notification settings - Fork 40.5k
-
Notifications
You must be signed in to change notification settings - Fork 40.5k
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
Error in the AOT test process if there are two tests that check an actuator endpoint. #34337
Comments
Thanks for the report, there's something wrong here. It seems that if two management contexts exists, it leads to this error. If i for example remove the |
I stumbled across the same error. Here is my repo with the error: https://github.com/Jul13nT/native-test-actuator Run One difference is that the Because of this, none of our tests of all our services are running and it prevents us of using GraalVM. Is there a possible workaround? |
I also ran into this bug in the same way. To work around it, I moved all If you do want to create integration tests to verify the actuator, it's still possible by creating a test classes annotated with |
I believe this is a duplicate of spring-projects/spring-framework#28974. |
Oh well, a duplicate of spring-projects/spring-framework#30861 then. |
The error can also be reproduced by running the tests in AOT mode on the JVM as follows. ./mvnw clean test spring-boot:process-test-aot && ./mvnw -Dspring.aot.enabled=true test More importantly... This issue has been fixed for the upcoming Spring Framework 6.0.12 release (see spring-projects/spring-framework#30861). To verify things work as expected, I updated <properties>
<java.version>17</java.version>
<spring-framework.version>6.0.12-SNAPSHOT</spring-framework.version>
</properties>
<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</repository>
</repositories> With that, the tests now pass in AOT mode on the JVM and within a native image. @ruben-garciapariente, @Jul13nT, and @robert-fennell-bk: feel free to give it a try with |
@robert-fennell-bk , I also ran into the same issue and I followed your suggestion, but with no luck. I even deleted all my Is there any chance that you can remember what kind of detective work you did back then in order to identify the root cause for your case? I believe I can follow the same steps as you did in order to find out what more/else is special about my app that is still suffering from this bug. Thank you in advance! |
@meletis what version of Spring Boot are you using? If you have the problem discussed in this issue, it should be fixed in Spring Boot 3.0.11 and later and 3.1.4 and later through the upgrade to Spring Framework 6.0.12. If you're already using such a version of Spring Boot then you may have a different problem. |
@wilkinsona , thanks, but I'm using Spring Boot 3.2.0. Yes, everything was fine until recently, when I was on 3.1.5. |
@meletis, that sounds like it may be a different problem. If you would like us to investigate, please open a new issue and provide a minimal sample that reproduces it. |
@wilkinsona , actually, I just realized that is very similar to #36997, which is also on 3.2.0. I also just discovered a IntelliJ plugin that can automatically attach the debugger to Java processes spawned by Gradle processes, so I'm now able to debug the |
Okay, that was easy with the debugger. I managed to reproduce the issue at my repo, using the There is one test class that is using an |
Hello
I'am using SB 3.0.2. I'm trying to pass the tests with native compilation with
mvn -PnativeTest clean install
and I get the following errorI think this happens if I have two tests of type
@SpringBootTest
with propertymanagement.server.port=0
.I have tried to create a minimal example: https://github.com/ruben-garciapariente/test-actuator-native
Thanks & regards
The text was updated successfully, but these errors were encountered: