Skip to content

Fix/dry run service completed successfully 14269 - #14270

Open
glours wants to merge 2 commits into
docker:mainfrom
glours:fix/dry-run-service-completed-successfully-14269
Open

glours wants to merge 2 commits into
docker:mainfrom
glours:fix/dry-run-service-completed-successfully-14269

Conversation

@glours

@glours glours commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

What I did
Fixed two related --dry-run bugs:

  1. docker compose --dry-run up -d hung forever when a service depended
    on another via depends_on: condition: service_completed_successfully.
    DryRunClient fakes container state as permanently running/healthy,
    which never satisfies the exited-state check that
    service_completed_successfully waits for — and since up -d applies
    no default timeout, the wait loop polled every 500ms indefinitely.
    isServiceCompleted now short-circuits to an immediate success in
    dry-run mode.

  2. docker compose --dry-run wait <service> failed with a misleading
    no containers for project "X" error instead of a clear signal that
    the command doesn't apply under simulation (wait has no real
    container to observe in dry-run). Wait now refuses upfront with a
    clear error instead.

Related issue

fixes #14269

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

DryRunClient fakes container state as permanently running/healthy,
which never satisfies the exited-state check that
service_completed_successfully waits for. With up -d passing no
default timeout, the wait loop polled forever and dry-run never
returned, even though no container was ever really started.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
Wait has no real container to observe in dry-run: getContainers
falls back to the live daemon and finds nothing, so the command
failed with a misleading "no containers for project" error instead
of signaling upfront that the operation doesn't apply under
simulation.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours
glours requested review from a team as code owners September 28, 2026 08:46
@glours
glours requested a review from ndeloof September 28, 2026 08:46

@docker-agent docker-agent 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.

Assessment: 🟢 APPROVE

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] dry-run up waits indefinitely for service_completed_successfully dependency

2 participants