-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
OpenTelemetryMetricsContainerConnectionDetailsFactoryIntegrationTests fails locally with container start error #38176
Comments
Possibly related to the testcontainers startup changes. |
The failure doesn't always make the test fail because |
The problem seems to be caused because of a lifecycle mismatch. The container is managed by the |
@philwebb You mentioned some changes in #38176 (comment). Can you clarify please what changes exactly you had in mind? I can't find any changes to shutdown lifecycle in the changelog. Is it possible to return the old behavior with some configuration property maybe? I have related problem in a project. With Spring Boot 3.1.6 tests worked fine, but now with Spring Boot 3.2.2, TestContainers are shutting down in parallel with Spring Application Context, that makes e.g. all DB connections in the HikariPool invalid. E.g. Spring Integration executes DefaultLockRepository.close() method on shutdown. This method executes an SQL query, so it expects a connection in the pool to be available. Previously it was working. Now it is not. Part of the log:
As you can see the container is already shutting down, so the Hiraki can't provide the connection. Moreover, it tries to create a new one (TestContainers JDBC URL Scheme is used to create the container), that also failed, but even if it was not, there is no sense in this operation as an empty DB (that missing the Liquibase migrations) will not help anyway. I want to find a solution that doesn't involve Basically, the ordering of shutdown of Spring Application Context and TestContainers should be guaranteed. TestContainers should always shut down last. I'm not sure where (in what project) I should create the issue. I'm not even sure what changes exactly affect this behavior. Maybe it's some changes in TestContainers itself that is 1.19.3 now. Edit |
The text was updated successfully, but these errors were encountered: