testcontainers / testcontainers/testcontainers-java
DockerComposeContainer withExposedService default wait strategy fails
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 8.7k
- Forks
- 1.9k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit DockerComposeContainer und den im Bericht beschriebenen Einstiegspunkten withExposedService(), getServiceHost() und getServicePort(), und untersuche dann anhand des gemeldeten docker-compose.yml-Setups die Standard-Wartestrategie und deren Portzuordnung. Reproduziere den Fehler und ermittle, ob die Strategie auf den zugeordneten Port des Dienstes wartet; als erledigt gilt die Aufgabe, wenn die Standardstrategie den korrekten Port erkennt oder das erforderliche Verhalten dokumentiert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, docker-compose, java
- Bereich
- devops, testing
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 32/100