testcontainers / testcontainers/testcontainers-python
Add a wait_for_healthcheck method to DockerCompose
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 386
- Avg merge
- 4h 40m
- Merged PRs (30d)
- 1
Description
It's possible to check if the healthcheck passed trought the cli.
docker ps --format json will list all the services running and their corresponding healthchecks.
Proposed method signature: compose.wait_for_healthcheck(sec: int = 10)
High level description how it should work:
Iterate trough services check if healthcheck is healthy.
If not: wait and repeat until timeout.
testcontaners java and node has the option to wait for healthcheck. It would be nice if testcontainers-python would have the same funtionality
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the DockerCompose implementation and inspect the Docker CLI output from docker ps --format json, along with the existing healthcheck options in the Java and Node testcontainers projects. Add the proposed wait_for_healthcheck behavior for all services, including polling and timeout handling, and verify it with tests for healthy and delayed healthchecks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, python
- Domain
- devops, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100