testcontainers / testcontainers/testcontainers-java

[Enhancement]: Reduce exceptions caused by Unreliables.retryUntilTrue

Aperta
#6,833 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

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

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 tracciando il punto di ingresso Unreliables.retryUntilTrue e il suo utilizzo da parte di DockerComposeContainer durante l’attesa dei container. Confronta il comportamento attuale dei tentativi basato sulle eccezioni con il percorso proposto senza eccezioni o con un’eccezione senza stacktrace, quindi definisci e testa una riduzione misurabile dell’overhead delle eccezioni senza modificare il comportamento di disponibilità.

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

Valutazione

Stack tecnologico
docker, docker-compose, java
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.