Skip to content

feat: add --wait flag to block until Microcks is ready after start#311

Open
mugiwaraluffy56 wants to merge 1 commit intomicrocks:masterfrom
mugiwaraluffy56:feat/start-readiness-wait
Open

feat: add --wait flag to block until Microcks is ready after start#311
mugiwaraluffy56 wants to merge 1 commit intomicrocks:masterfrom
mugiwaraluffy56:feat/start-readiness-wait

Conversation

@mugiwaraluffy56
Copy link
Copy Markdown
Contributor

@mugiwaraluffy56 mugiwaraluffy56 commented May 6, 2026

Closes #303.

microcks start returns as soon as the container is created, but the server inside takes a few seconds to initialize. Running microcks import or microcks test right after start fails with a connection error because the API is not up yet.

Adding --wait makes microcks start block and poll GET /api/health on the mapped port until it returns 200, then exit. An optional --wait-timeout flag (default 30 seconds) controls how long to wait before giving up with an error.

microcks start --wait
microcks start --wait --wait-timeout 60

This is the same readiness strategy the Microcks Testcontainers module uses internally. It also makes the --dry-run path in #255 straightforward to build on top of, since it needs to know when the ephemeral container is ready before importing an artifact.

Before (no --wait):
bug

After (with --wait):
wait

Import succeeds after --wait:
import

Tests cover the happy path, retry-then-succeed, timeout, and URL construction. All existing tests still pass.

Signed-off-by: puneeth_aditya_5656 <myakampuneeth@gmail.com>
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.

feat: wait for Microcks readiness after start

1 participant