The ApplicationContext has a resource cache that it uses while the context is being refreshed. Once the refresh phase completes, the cache is cleared as its content is no longer in use. If beans are lazily initialized, there is a case where the cache might be filled again as processing is deferred past the refresh phase. For those cases, the cache is not cleared. This can be a problem when running in this mode with a large set of test configurations as the TCF caches the related contexts. This commit includes an additional TestExecutionListener to the TCF that clears the resource cache if necessary once a test class completes. It is ordered so that it runs after `@DirtiesContext` support as marking the context as dirty will remove it from the cache and make that extra step unnecessary. Closes gh-30954 |
||
|---|---|---|
| .. | ||
| src | ||
| .springBeans | ||
| spring-test.gradle | ||