spring-boot/spring-boot-project/spring-boot-testcontainers
Phillip Webb ccc1b5da28 Don't call Startable.start() for already started containers
Add a new `TestcontainersStartup.start` static method and update the
existing start methods so that `Startable.start()` is only called when
the container is not already running.

Prior to this commit, we assumed that `Startable.start()` calls were
idempotent and could be safely made multiple times. Whilst this appears
to be true for stock `GenericContainer` based startables, users may have
their own `start()` method that does not expect to be called multiple
times.

The implemented detection logic will not be applied if a `Startable`
is not also a `Container`. In these cases, the implementation will need
to deal directly with multiple `start()` calls.

Fixed gh-43253
2024-12-12 15:26:59 -08:00
..
2024-12-03 19:07:55 -08:00