testcontainers / testcontainers/testcontainers-java
DockerComposeContainer withExposedService default wait strategy fails
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 8.7k
- Forks
- 1.9k
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 9
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par DockerComposeContainer et les points d’entrée withExposedService(), getServiceHost() et getServicePort() décrits dans le rapport, puis examinez la stratégie d’attente par défaut et son mappage de ports avec la configuration docker-compose.yml indiquée. Reproduisez l’échec et déterminez si la stratégie attend le port mappé du service ; le travail est terminé lorsque la stratégie par défaut identifie le port correct ou que le comportement requis est documenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- docker, docker-compose, java
- Domaine
- devops, testing
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 32/100