-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
MicrometerObservationRegistryTestExecutionListener
uses wrong ClassLoader
to detect dependencies
#30726
Comments
I can't reproduce the issue that you've described. How do you run the test? Have you tried on the command line? |
I can also see it using ./gradlew test --debug. I was running this in Intellij simply by running the test. The output is DEBUG only and on reflection it doesn't prevent the tests from running however this stacktrace never appeared in 3.0.7. However, I'm not sure if this causes issues at runtime if Micrometer is enabled. |
That's how the TestContext framework works I am afraid. It'll load the execution listener and prints such a stacktrace if the class can't be loaded (due to a missing optional dependency). Moving to framework for their consideration as this class is not part of Spring Boot. |
The class should be there with Micrometer 10.1.8. I can only reproduce this specific failure by downgrading Micrometer to 1.10.7. With 1.10.8 I see a different exception being logged at debug level:
I believe it's happening because it's referring to
I think it should have been |
MicrometerObservationRegistryTestExecutionListener
fails to load with vanilla setup
Trying to work around the reference to the wrong
I now see the failure that was originally reported. Perhaps because the wrong |
Good catch, @wilkinsona! And... that's embarrassing. I'll fix that right away. |
MicrometerObservationRegistryTestExecutionListener
fails to load with vanilla setupMicrometerObservationRegistryTestExecutionListener
uses wrong ClassLoader
to detect dependencies
This has been fixed for inclusion in Please try out the upcoming |
While the ClassLoader's now correct, the noisy debug logging still occurs:
The problem is that, while |
Hi @wilkinsona, Thanks for confirming that the I'll improve those in time for 6.0.11. |
Closing this issue again since the The issues with logging will be addressed in #30747. |
This occurred have updating from 3.0.7->3.0.8
Reproduced on clean app
Create a simple demo app with 3.0.8 using https://start.spring.io/
Add
Now, run the DemoApplicationTests in the generated demo project.
It will fail with
java.lang.NoClassDefFoundError: io/micrometer/context/ThreadLocalAccessor
From looking at the dependencies, the missing classes are part of micrometer-propagation which is only an optional dependency of
micrometer-observation-1.10.8.pom
Should the spring-web pom have a compile dependency on the above package too?
The text was updated successfully, but these errors were encountered: