Add hint to allow retry after previous cached failure to find Docker environment#7533
Add hint to allow retry after previous cached failure to find Docker environment#7533cbreezier wants to merge 1 commit intotestcontainers:mainfrom
Conversation
…to find a Docker environment
|
Thanks for your contribution, @cbreezier. But, since this is mostly related to gradle users and a misconfigured container runtime we have decided to not merge this. |
|
@eddumelendez this is looks like middle-finger response. What exactly misconfigured in runtime and how to fix it or troubleshoot? Especially if it worked without changes for years and at some point broke. |
|
@rlconst What kind of environment/setup do you have in which you face this issue? We routinely learned that such issues don't apply to users once the container runtime is correctly setup (and please note, only Docker CE and Docker Desktop are the container runtimes officially supported by Testcontainers, everything else is on a best-effort basis). |
|
@kiview if you give me instruction how to gather information I'll happily provide Windows 11 23H2 (22631.4317), Dell XPS Libs: I see docker itself is outdated. I'll update and report if the problem still persist in Docker 4.34.3. The same setup works flawlessly inside k8s environment of github ce, so something with windows. UPD: still failing on a new docker and became even worse: It helped to pull postgres and ruyk manually and disable containerd in docker settings. Still failing if build failed for some reason but |
|
I'm running into this as well. My Docker environment is just Docker Desktop, but I don't have it configured to start on machine startup (since I use it only occasionally). When running testcontainers without starting the Docker engine, I get into this "won't retry" state. |
|
I keep running into this issue which is quite annoying, seems like a strange decision. Anyway for me with Gradle and Orbstack, I killed any Gradle daemons and restarted Orbstack and things seems to run again. Hope that saves someone else a lot of wasted time. |
Related to #6441
As per the linked issue, the original behaviour to disable retries to find a valid Docker environment was introduced in #456
However, this can lead to frustrating situations where it becomes impossible to rerun builds if testcontainers was ever accidentally run without a valid Docker environment present. This happens when a long-running daemon (eg, Gradle daemon) keeps the testcontainers classes around and the
FAIL_FAST_ALWAYSflag is never cleared.I don't think it's worth adding special commands to somehow reset this flag, and the original fix sounds like it addresses a valid problem.
If the maintainers think that it's worth it, it may be worth considering changing the
FAIL_FAST_ALWAYSboolean to a timestamp and essentially cache the failure for a limited time, rather than forever. This at least provides an upper bound for the number of unnecessary pings to check a Docker environment.My current PR simply adds a hint to users about why testcontainers is never retrying, and how to force a retry.