fix(test-springboot): wait for compose services to be healthy before testing#49
Merged
Merged
Conversation
…testing docker compose up -d returns as soon as containers start, not once they're actually ready. For Postgres (and any other compose-file consumer with a healthcheck), that let the test step run before the DB was accepting connections, causing persistent connection-refused failures. Add --wait so the step blocks until compose reports the started services as healthy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docker compose up -dreturns as soon as containers start, not once they're actually ready to accept connections.compose-file/compose-profileinputs with a healthcheck defined (e.g. Postgres viapg_isready), this let the test step run before the service was actually ready, causing persistent connection-refused failures in downstream test suites.--waitto thedocker compose up -dinvocation so the step blocks until all started services report healthy.Context
Found while investigating a persistently failing "Test Spring Boot App" check on lenra-io/Ximiti#47: a new test suite connecting directly to Postgres kept failing with
ConnectExceptionfor the entire retry window, even after retries up to 180s, while the Postgres container had already reported "Started". Postgres'spg_isreadyhealthcheck incompose.ymlwas already defined but never actually waited on.Test plan
main(it references@main) and confirm it passes.Generated by Claude Code