testcontainers / testcontainers/testcontainers-java

[Enhancement]: Reduce exceptions caused by Unreliables.retryUntilTrue

Abierto
#6,833 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

type/enhancement
Lenguaje dominante
Java
Estrellas
8.7k
Forks
1.9k
Merge medio
2 d 17 h
PR fusionados (30 d)
9

Descripción

Module

Core

Proposal

Hi 👋

I've been profiling test pipelines in our in-house projects and noticed on several Spring-Boot related projects that use DockerComposeContainer that a large amount of exceptions is thrown when waiting for the containers to start.
image

Throwing RuntimeExceptions with the message "Not ready yet" is not really exceptional here - on the contrary. It's rather the norm. I can't imagine this to be super efficient. It would be great if an alternative solution could be implemented that isn't based on exceptions. Or short-term alternative: throwing a dedicate exception with fillInStackTrace overridden to at least avoid the overhead of generating the stacktrace.

	class NotReadyYetException extends RuntimeException {

		public NotReadyYetException() {
			super("Not ready yet");
		}

		@Override
		public synchronized Throwable fillInStackTrace() {
			return this;
		}

	}

Or caching the exception....

Because duct-tape seems to be read only, I hope this is the correct place for this report. Please lead me to the correct place if not. I'm also open to provide the short term solution somewhere if you want me to and you think this is worthwhile.

Let me know what you think.

Cheers,
Christoph

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza rastreando el punto de entrada Unreliables.retryUntilTrue y su uso por parte de DockerComposeContainer al esperar a los contenedores. Compara el comportamiento actual de reintento basado en excepciones con la ruta propuesta sin excepciones o con una excepción sin stacktrace; después, define y prueba una reducción medible de la sobrecarga de las excepciones sin cambiar el comportamiento de disponibilidad.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
docker, docker-compose, java
Área
testing
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.