-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Spring Boot should release test contexts which failed to load #28021
Comments
Potentially related to: |
If an Can you please expound on what you mean by "fails loading"? Also, please provide a sample application that demonstrates the issue you are encountering -- preferably as a Git repo or Zip file that we can download and run. Stack traces for the failure scenarios would also be useful so that we can better see where things are going wrong. |
@sbrannen, you were right, Spring Boot's |
Thanks! |
Affects: 5.3.15
For a Spring Boot project with many tests loading the Spring context (
@SpringBootTest
): if loading the Spring context fails, the context will remain in memory and test execution will eventually fail withOutOfMemoryError
(hiding the original problem).I created a heap dump of a failed run. I see 109 instances of
org.springframework.beans.factory.support.DefaultListableBeanFactory
on the heap. I see these paths to GC roots preventing the context from being garbage collected:The context should be closed, when it fails loading. At least for tests.
The text was updated successfully, but these errors were encountered: