Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Apply one startup deadline from container start to ready

Aperta
#1,582 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@cristianrgreco ci sta già lavorando.

Dal 12/10/2026.

  • #1584 di @cristianrgreco — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, node.js, typescript
Ambito
backend, testing

Direzione di ricerca

Read generic-container/generic-container.ts at startContainer and reuseContainer, then trace the exposed-port inspection utility and wait-strategy.ts through each strategy and the Kafka, Redpanda, and Couchbase containerStarted hooks. Check the linked dependency issues and the core tests that assert timeout errors. Decide whether image pulling counts toward the shared deadline and coordinate the timeout precedence and hook context; done means all startup phases share one deadline and report the waiting phase and total budget.

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

Descrizione

enhancement major

What happens

withStartupTimeout(ms) reads as "the container must be ready within this long". It is applied per phase instead, so start() can take several times longer than the value given before it fails:

  • The image pull has no limit.
  • The port-binding wait has its own fixed 30 second limit, separate from the startup timeout.
  • The wait strategy gets the full timeout, counted from the moment the wait begins.
  • Modules that wait again in containerStarted restart the clock. Kafka and Redpanda apply startupTimeoutMs to a second wait, so a Kafka container with its default of 180 seconds can run for close to 360 before failing.

Expected

One deadline, fixed when the container is started. The port-binding wait, the wait strategy and the hooks each get what is left of it. When it runs out, the error says which phase was waiting and what the total budget was.

Where

  • startContainer and reuseContainer in packages/testcontainers/src/generic-container/generic-container.ts
  • packages/testcontainers/src/generic-container/inspect-container-util-ports-exposed.ts
  • packages/testcontainers/src/wait-strategies/wait-strategy.ts and every strategy
  • containerStarted in the kafka, redpanda and couchbase modules

Notes

  • This cannot be done compatibly. The strategy has to be told the deadline. Passing the remaining time through withStartupTimeout changes the error text, which core tests assert exactly (not accessible after 3000ms), and changes the caller's strategy instance. A new argument to waitUntilReady is an interface change. Hence major.
  • Go gets this from context: each strategy calls context.WithTimeout(ctx, timeout), so the caller's context is the ceiling and a strategy's own timeout can only shorten it.
  • #1494 kept the port-binding limit independent of withStartupTimeout, because tying them together would let each phase use the full timeout. A shared deadline removes that objection.
  • Decide whether the image pull counts towards the deadline.
  • A compatible first step is being prepared separately: the remaining startup time is passed to containerStarted, so module waits after the wait strategy stop restarting the clock.
  • Related: #1446, #1513.

Dependencies

  • Blocked by #1558, #1560: both change what waitUntilReady receives. The deadline should travel in what they add, so the interface changes once.
  • Coordinate with #1523: the precedence between a container timeout and a strategy timeout has to be one rule.
  • Coordinate with #1554: hooks should be given the remaining time through their context.
Lingua principale
TypeScript
Stelle
2.6k
Fork
274
Merge medio
1g 14h
PR unite (30g)
44

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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.

Altre issue di testcontainers/testcontainers-node

Tutte le issue di testcontainers/testcontainers-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.