testcontainers / testcontainers/testcontainers-java
Improve logging when withReuse() is specified and a container cannot be reused.
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
I would like to see a warning logged everytime a container is started withReuse(true) and the hash does not match.
Ideally the warning should contain details of the existing running containers, their container ids and mismatched hashes.
And if possible it would be REALLY helpful to have some details about why the hash didn't match. I realize from reading the code that this isn't possible currently given that the hash is computed from the CreateContainerCmd but maybe some comparisions would be performed of the InspectContainerResponse post container start, as compared to the existing containers.. It would probably make sense to log this level of detail at DEBUG or TRACE levels.
Right now we are facing issues where it's very easy to trigger new containers to be created when the intent was to reuse an existing container, and it's very easy to miss this happening in the logs unless you are paying special attention to it.
And once you've spotted it, it's very hard to troubleshoot why a new container was created vs an existing one being reused.
Sometimes it's some init-data that was updated so the files hash has changed, othertimes, it's something more subtle like a host bind path having a trailing / but otherwise being exactly the same.. This last issue has other implications, which probably warrants it's own ticket, but at the moment it's hard to gather all the evidence easily.. hence this ticket.
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 suivre withReuse(true) à travers le chemin de réutilisation des conteneurs, puis examinez comment le hash de CreateContainerCmd est comparé aux conteneurs existants en cours d’exécution. Examinez les détails disponibles de InspectContainerResponse et les points de journalisation. Le travail est considéré comme terminé lorsqu’une incompatibilité de réutilisation émet un avertissement contenant les IDs des conteneurs et les hashes, avec des détails de comparaison plus approfondis au niveau DEBUG ou TRACE lorsque cela est disponible.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- docker, java
- Domaine
- observability, testing
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100