Error encountered exiting Spring ApplicationContext at the end of a @SpringBootTest
using Testcontainers & Modulith
#450
Labels
meta: waiting for feedback
Waiting for feedback of the original reporter
Spring Boot version: 3.2.1
Spring Modulith version: 1.1.1
Testcontainers PostgreSQL version: 1.19.3
We have noticed an issue when using Spring Modulith in conjunction with a
@SpringBootTest
and a Testconainers initialization. The test successfully passes but then the execution suspends for several seconds before logging the below errors/warnings:The amount of time it suspends for seems to be connected to the Hikari connection timeout value.
From the logs, it appears that the
DefaultEventPublicationRegistry
, which implementsDisposableBean
, is having itsdestroy
method called after the Testcontainers DB has already been shutdown.We found this issue on the Testcontainers Java repo and this issue on the Spring Boot repo which describe what sounds like a very similar problem.
Was wondering if anyone has more insight into why this happens or knows of a solution that would potentially fix it.
The text was updated successfully, but these errors were encountered: