spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.31k stars 40.71k forks source link

TestContainer started twice since 3.4 #43253

Open marcantoine-bibeau opened 8 hours ago

marcantoine-bibeau commented 8 hours ago

ContainerConnectionDetailsFactory.getContainer() is doing

if (this.container instanceof Startable startable) {
                startable.start();
            }

While TestcontainersLifecycleBeanPostProcessor.initializeStartables(...) already started the MockServer

philwebb commented 6 hours ago

Is this causing an issue? Can you provide a sample application showing the actual problem you're facing?

marcantoine-bibeau commented 3 hours ago

I do not think it creates a big problem but still created a regression on my side because I'm wrapping the MockServer and override the start() method to perform additional stuff. I can fix by verifying if the TestContainer is running but would be ideal to not start twice?