Skip to content

fix(up): wait for every replica in --wait and service_completed_successfully - #14523

Merged
ndeloof merged 1 commit into
docker:mainfrom
Zoomish:14521-wait-all-replicas
Nov 18, 2026
Merged

ndeloof merged 1 commit into
docker:mainfrom
Zoomish:14521-wait-all-replicas

Conversation

@Zoomish

@Zoomish Zoomish commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

docker compose up --wait and depends_on with service_completed_successfully treat a scaled service as ready after one replica. This waits until every replica meets the condition. One failed replica still fails the wait.

Related issue

Fixes #14521

Changes made

  • isServiceHealthy keeps scanning after a running replica with no healthcheck, and after a healthcheck that is still starting. The service is ready only when every replica is ready. exited, unhealthy, and an unknown health status still fail immediately.
  • isServiceCompleted returns success only when every replica has exited 0. A non-zero exit still fails immediately. An empty container list and dry-run are unchanged.
  • Unit tests cover two replicas, with the failing replica second, for both checks.

Testing done

  • Unit tests pass: make test
  • E2E tests pass: make e2e-compose or make e2e-compose-standalone
  • Linting passes: make lint
  • Code formatted: make fmt
  • Manually tested (describe):

make lint finished with 0 issues. make test passed. make fmt made no content changes.

Additional context

(not mandatory) A picture of a cute animal, if possible in relation to what you did
My cat (Helped me)
image

@Zoomish
Zoomish requested review from a team as code owners November 17, 2026 09:23
@Zoomish
Zoomish requested review from glours and ndeloof November 17, 2026 09:23
@Zoomish Zoomish changed the title feat(tests): add comprehensive health check tests for service replicas Nov 17, 2026
…ssfully

Signed-off-by: Egor Rezvyi <99123419+Zoomish@users.noreply.github.com>
@Zoomish
Zoomish force-pushed the 14521-wait-all-replicas branch from eb7a546 to 141e471 Compare November 17, 2026 09:32

@ndeloof ndeloof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

nit: when a replica fails, checkDependencyCompleted marks every replica as errored, including one that exited 0 (the new test pins test-db-1 as StatusError). That is the existing per-container-list reporting, so fine to leave, but it reads oddly with replicas that completed successfully.

@ndeloof
ndeloof enabled auto-merge (rebase) November 18, 2026 07:08
@ndeloof
ndeloof merged commit 34548ed into docker:main Nov 18, 2026
60 checks passed
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants