testcontainers/testcontainers-spock

Containers from superclass are started twice

iNikem opened this issue · 0 comments

I have a problem with @Testcontainers annotation trying to start a container twice. I have a superclass and subclass. Both have some containers so both have @Testcontainers annotation. And it looks like the containers from the superclass are started 2 times, thus failing

Probably it would make sense to check org.testcontainers.containers.GenericContainer#isRunning before starting it in https://github.com/testcontainers/testcontainers-spock/blob/master/src/main/groovy/com/groovycoder/spockdockerextension/TestcontainersMethodInterceptor.groovy#L76