-
Notifications
You must be signed in to change notification settings - Fork 56
perf(testcontainers): replace rabbitmq-diagnostics healthcheck with raw TCP probe #10331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,10 @@ services: | |
| RABBITMQ_DEFAULT_USER: infrahub | ||
| RABBITMQ_DEFAULT_PASS: infrahub | ||
| healthcheck: | ||
| test: rabbitmq-diagnostics -q check_port_connectivity | ||
| # raw TCP probe instead of rabbitmq-diagnostics: each diagnostics call | ||
| # boots a full Erlang VM (~2s CPU), which at a 1s interval pegs two | ||
| # cores per broker for the life of the stack | ||
| test: ["CMD", "bash", "-c", "</dev/tcp/127.0.0.1/5672"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if the problem here is |
||
| interval: 1s | ||
| timeout: 1s | ||
| retries: 50 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This healthcheck hard-requires bash in the broker image, but the image is configurable via MESSAGE_QUEUE_DOCKER_IMAGE. If anyone runs the stack against a non-Debian rabbitmq image (e.g. an alpine variant or a custom build) that lacks bash, the exec-form probe fails to find bash, the healthcheck reports unhealthy, and depends_on: service_healthy for message-queue blocks the whole stack from starting. The previous rabbitmq-diagnostics form worked on any rabbitmq image. Note the fragility in the comment or fall back to a form that doesn't depend on bash when /bin/sh is dash.
Prompt for AI agents