testcontainers / testcontainers/testcontainers-java
[Enhancement]: Reduce exceptions caused by Unreliables.retryUntilTrue
Nessuno ha ancora preso questa issue.
- 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.

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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- 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