testcontainers / testcontainers/testcontainers-java

DockerComposeContainer withExposedService default wait strategy fails

Aperta
#2,886 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Hello again :)

Since I can't use container_name in my docker-compose.yml I have to dynamically set the configuration of a service via environment variables. To do so I call .getServiceHost() and .getServicePort() to retrieve the values. In order to be able to call them I need to add .withExposedService() to my DockerComposeContainer instance (that is already strange as I could just have ports or expose defined in my docker-compose.yml).

Using the default wait strategy fails because it tries to identify listening to some unknown port like 32824. As I see it's mapped either by ryuk or socat containers but the first one is not even at the same network all the services from the docker-compose.yml defined. As a workaround I just created a dummy anonymous class with an empty waitUntilReady implementation.

Why does it try to listen for the strange port not related to my service? Or why does the mapping between my service's port and the corresponding 'ambassador' one fail?

Thanks. Gonna appreciate any docs on that as well.

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 con DockerComposeContainer e con i punti di ingresso withExposedService(), getServiceHost() e getServicePort() descritti nel report, quindi esamina la strategia di attesa predefinita e la relativa mappatura delle porte utilizzando la configurazione docker-compose.yml riportata. Riproduci il malfunzionamento e determina se la strategia attende sulla porta mappata del servizio; il lavoro è completato quando la strategia predefinita identifica la porta corretta oppure viene documentato il comportamento richiesto.

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

Valutazione

Stack tecnologico
docker, docker-compose, java
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
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.