Replies: 1 comment
-
Hi @treydavis, This is the default behaviour. If your containers define their own healthchecks, you simply need to tell Testcontainers to use them: const container = await new GenericContainer("my-container-with-health-check)
.withWaitStrategy(Wait.forHealthCheck()) There is an issue related to this, which suggests Testcontainers should automatically switch to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm running into a small inconvenience related to using distroless containers with
DockerComposeEnvironment
. Distroless images don't work with the default port wait strategy. This means I have to usewithWaitStrategy
to override the strategy for my distroless container. However, I would like to keep specific container-related info out of my tests. For example, I'd like to avoid this:I'd rather create a
healthcheck
forsome-specific-container
in my Docker compose file so that all the container-specific configs are defined in one place, inside the container definition.This approach has led me to wish for a configurable default wait strategy:
Or, perhaps, an alternative signature to
withWaitStrategy
(or a separate method name) that accepts a function mapping container to wait strategy:Beta Was this translation helpful? Give feedback.
All reactions