testcontainers / testcontainers/testcontainers-java

[Feature]: Inverse of "GenericContainer.waitingFor()" to catch failing startup, avoid long wait

Aperta
#6,066 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Module

No response

Problem

I have a container that takes quite a while to start up successfully (with somewhat unpredictable time, requiring longish time out for positive signal), but can fail quickly; in both cases there are log lines that are reliable indicators.

But there is no way to check for negative indicators (in my case, log line stating Unable to start server. Exiting...), and as a result failure detection with timeout (failing to find positive signal) takes a very long time, due to necessity of using relatively long timeout for getting success signal.

Solution

It would be great to have an option for short-circuiting this by indicating failure condition(s): this could also be propagated as failure reason to calling code including transparency.

I realize that often testing for negative cases is fool's errand (there may well be countless ways for things to fail); but at least in my case there is one very common failure mode.

Note: it is not necessary to support all the options of waitingFor(): for me ability to match log entries would be sufficient.

Benefit

For use cases like mine there would be much faster runtime for cases where container startup can fail in a detectable way.

Alternatives

I do not TestContainers well enough to know if something like this might already exist (apologies if so; I did try to google for it), or if there is an alternative approach.

Would you like to help contributing this feature?

No

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 dall’API GenericContainer.waitingFor() e traccia il percorso del risultato di avvio fino al codice chiamante. Determina l’ambito di una condizione di corrispondenza negativa nei log e come debba essere esposto il motivo del suo fallimento; il lavoro è completo quando esiste un’API documentata e testata che interrompe immediatamente l’esecuzione in presenza del fallimento di avvio segnalato.

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

Valutazione

Stack tecnologico
docker, 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
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.