Many have reported that the test environment startup fails on the initial docker compose up (some services don’t start) but a couple more docker compose up invocations fix the issue.
The underlying problem is that all services have healthchecks configured and interdependent services wait for one another to be healthy, not just started. The healthchecks impose timeouts: for example, a check could try pinging the service 3 times, each time waiting 15 seconds for a response (in realitly, there are more parameters). This means that if the service does not reach a ‘healthy’ state (meaning it replies to the ping) in 45 seconds, Docker Compose will give up and consider that service failed and cascade this failure to dependent services. In the meantime, the container is still setting up, so by the time you issue a second docker compose up, the container might be ready to accept connections and respond to the healthcheck ping.
I would keep healthchecks but relax their timeouts.
Rough outline of subtasks:
Many have reported that the test environment startup fails on the initial
docker compose up(some services don’t start) but a couple moredocker compose upinvocations fix the issue.The underlying problem is that all services have healthchecks configured and interdependent services wait for one another to be healthy, not just started. The healthchecks impose timeouts: for example, a check could try pinging the service 3 times, each time waiting 15 seconds for a response (in realitly, there are more parameters). This means that if the service does not reach a ‘healthy’ state (meaning it replies to the ping) in 45 seconds, Docker Compose will give up and consider that service failed and cascade this failure to dependent services. In the meantime, the container is still setting up, so by the time you issue a second
docker compose up, the container might be ready to accept connections and respond to the healthcheck ping.I would keep healthchecks but relax their timeouts.
Rough outline of subtasks:
Dockerfiles and some are defined in the Compose YAMLs)