Open dreis2211 opened 1 year ago
Example usage
public static DockerComposeContainer<?> container = new DockerComposeContainer<>(
new File("../../docker/configs/docker-compose-integration-test.yml")
)
.withLocalCompose(true)
.withPull(true)
.withExposedService("serviceA", 8086, Wait.forHealthcheck())
.withExposedService("serviceB", 5432, Wait.forHealthcheck())
.withExposedService("redis", 6379, Wait.forHealthcheck())
.withExposedService("serviceC", 14268, Wait.forHttp("/").forStatusCode(404))
.withExposedService("serviceD", 8090, Wait.defaultWaitStrategy().withStartupTimeout(Duration.ofMinutes(3)));
protected void start() {
container.start();
}
Module
Core
Proposal
Hi 👋
I've been profiling test pipelines in our in-house projects and noticed on several Spring-Boot related projects that use
DockerComposeContainer
that a large amount of exceptions is thrown when waiting for the containers to start.Throwing
RuntimeException
s with the message"Not ready yet"
is not really exceptional here - on the contrary. It's rather the norm. I can't imagine this to be super efficient. It would be great if an alternative solution could be implemented that isn't based on exceptions. Or short-term alternative: throwing a dedicate exception withfillInStackTrace
overridden to at least avoid the overhead of generating the stacktrace.Or caching the exception....
Because
duct-tape
seems to be read only, I hope this is the correct place for this report. Please lead me to the correct place if not. I'm also open to provide the short term solution somewhere if you want me to and you think this is worthwhile.Let me know what you think.
Cheers, Christoph