Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Let `Wait.forListeningPorts()` wait on specific ports

Open Beginner friendly
#1,533 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, node.js, typescript
Domain
devtools, testing

Research direction

Start with packages/testcontainers/src/wait-strategies/wait.ts and packages/testcontainers/src/wait-strategies/host-port-wait-strategy.ts to see how Wait.forListeningPorts() selects exposed ports. Check nearby wait strategy tests for the current behavior, then add coverage for selecting specific ports and for calling it without arguments. Done means selected ports are awaited, while the no-argument call still waits for all exposed ports.

Written by the indexing model from the issue text.

Description

enhancement minor

What happens

Wait.forListeningPorts() takes no arguments and waits for every exposed TCP port, both from the host and inside the container. There is no way to wait on a subset.

A container that exposes a port which opens late, opens on demand, or is optional (a debug or metrics port) cannot use the strategy. The choices are to stop exposing the port or to switch to a different wait strategy.

Expected

Wait.forListeningPorts(...ports) waits only for the ports given, and for all exposed ports when called without arguments.

Where

  • packages/testcontainers/src/wait-strategies/wait.ts
  • packages/testcontainers/src/wait-strategies/host-port-wait-strategy.ts

Notes

  • Java has Wait.forListeningPorts(int... ports). Go has wait.ForListeningPort(port) next to wait.ForExposedPort().
  • Related: #1108 (listening ports wait with several exposed ports on Podman).

Dependencies

  • Nothing blocks this. It can start now.
Dominant language
TypeScript
Stars
2.6k
Forks
274
Avg merge
1d 14h
Merged PRs (30d)
44

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from testcontainers/testcontainers-node

All issues in testcontainers/testcontainers-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.