testcontainers / testcontainers/testcontainers-java

Docker compose with Citus images fails to start

Aperta
#3,179 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

stale
Lingua principale
Java
Stelle
8.7k
Fork
1.9k
Merge medio
2g 17h
PR unite (30g)
9

Descrizione

I run integration tests within a Spring Boot and have a defined docker-compose file: https://github.com/citusdata/docker/blob/master/docker-compose.yml

The DockerComposeContainer config:

final var container = new DockerComposeContainer(dockerComposeFile)
            .withLocalCompose(true)
            .withExposedService("master", 5432, Wait.forListeningPort())
            .withExposedService("manager", 5432, Wait.forLogMessage(STARTUP_MESSAGE_FROM_CONTAINER, 1))
            .withExposedService("worker", 5432, Wait.forListeningPort());
        container.start();

        return container;

So the problem is that after 3-4 test classes starting and shutting down the compose file(the tests execute successfully and everything is fine), I get this error on the next test class.

t.test.mock.mockito.ResetMocksTestExecutionListener@4cd0e037, org.spockframework.spring.SpringMockTestExecutionListener@72af31b2]
    2020-08-31 22:34:19.423  INFO 5088 --- [    Test worker] o.t.containers.DockerComposeContainer    : Preemptively checking local images for 'citusdata/membership-manager:0.3.0', referenced via a compose file or transitive Dockerfile. If not available, it will be pulled.
    2020-08-31 22:34:19.432  INFO 5088 --- [    Test worker] o.t.containers.DockerComposeContainer    : Preemptively checking local images for 'citusdata/citus:9.4.0', referenced via a compose file or transitive Dockerfile. If not available, it will be pulled.
    2020-08-31 22:34:19.442  INFO 5088 --- [    Test worker] 🐳 [docker-compose]                      : Local Docker Compose is running command: up -d
    2020-08-31 22:34:19.593  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : Creating network "cbx9ms68ba5j_default" with the default driver
    2020-08-31 22:34:19.686  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : Creating volume "cbx9ms68ba5j_healthcheck-volume" with default driver

    2020-08-31 22:34:20.162  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : Creating cbx9ms68ba5j_master_1 ... done
    2020-08-31 22:34:20.164  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : 

    2020-08-31 22:34:20.677  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : Creating cbx9ms68ba5j_manager_1 ... done
    2020-08-31 22:34:20.679  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : 

    2020-08-31 22:34:21.284  INFO 5088 --- [      Thread-13] 🐳 [docker-compose]                      : Creating cbx9ms68ba5j_worker_1  ... done
    2020-08-31 22:34:21.304  INFO 5088 --- [    Test worker] 🐳 [docker-compose]                      : 
> :users:integrationTest > Executing test com.users.UsersQueryResolverTest
    2020-08-31 22:34:21.305  INFO 5088 --- [    Test worker] 🐳 [docker-compose]                      : Docker Compose has finished running
    2020-08-31 22:34:21.305  INFO 5088 --- [    Test worker] 🐳 [alpine/socat:latest]                 : Creating container for image: alpine/socat:latest
    2020-08-31 22:34:21.312 ERROR 5088 --- [    Test worker] 🐳 [alpine/socat:latest]                 : Could not start container

    org.testcontainers.containers.ContainerLaunchException: Aborting attempt to link to container cbx9mskvyfm7_master_1 as it is not running
   2020-08-31 22:34:21.313  INFO 5088 --- [    Test worker] 🐳 [docker-compose]                      : Local Docker Compose is running command: down -v

    2020-08-31 22:34:31.914  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : Stopping cbx9ms68ba5j_worker_1  ... done
    2020-08-31 22:34:32.368  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : 

    2020-08-31 22:34:32.368  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : Stopping cbx9ms68ba5j_manager_1 ... done
    2020-08-31 22:34:32.848  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : 

    2020-08-31 22:34:32.858  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : 

    2020-08-31 22:34:32.891  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : Removing cbx9ms68ba5j_worker_1  ... done

    2020-08-31 22:34:32.911  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : Removing cbx9ms68ba5j_master_1  ... done
    2020-08-31 22:34:32.911  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : Removing network cbx9ms68ba5j_default
    2020-08-31 22:34:33.188  INFO 5088 --- [      Thread-15] 🐳 [docker-compose]                      : Removing volume cbx9ms68ba5j_healthcheck-volume
    2020-08-31 22:34:33.213  INFO 5088 --- [    Test worker] 🐳 [docker-compose]                      : Docker Compose has finished running

com.users.UsersQueryResolverTest > classMethod FAILED
    org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:330
        Caused by: org.rnorth.ducttape.RetryCountExceededException at Unreliables.java:88

Any ideas what might be the cause?
Thanks.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da DockerComposeContainer e dal docker-compose.yml collegato, quindi riproduci il problema eseguendo ripetutamente le classi dei test di integrazione. Segui la transizione dall’avvio di Compose al problema di linking di GenericContainer ed esamina il ciclo di vita del container registrato nei log. Il lavoro è completato quando la causa è stata identificata e viene aggiunto un test di regressione che copra avvii e arresti ripetuti di Compose.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, docker-compose, java, spring-boot
Ambito
devops, testing
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.