Open sushi30 opened 3 months ago
if this workaround works, it means the container is coming up successfully but the healthcheck is reporting a false negative result. this means the healthcheck for minio is broken. can you confirm which os/arch/python/docker/tc you're using?
this script takes about 2 seconds to run on my mac (m1/3.12/tc runtime/4.5.0):
python -m venv .venv && . .venv/bin/activate
pip install testcontainers[minio]
from testcontainers.minio import *
with MinioContainer() as m:
client = Minio(
f"localhost:{m.get_exposed_port(9000)}",
access_key="minioadmin",
secret_key="minioadmin",
secure=False
)
client.make_bucket("abc")
print(client.list_buckets())
I can confirm this issue is with elasticsearch too.. Just but a debugger in waiting_utils
and you'll the nested calls:
the nested calls are fine - you do need to wait for all of that before getting mapped ports
but shouldn't the total timeout be 120 seconds? the nested calls should have awareness of how much time passed since the container was started.
that could be improved, i agree, but in general it doesn't introduce new errors
Describe the bug
MinioContainer._healthcheck is decorated with
wait_container_is_ready
and callsget_exposed_port
which is also decoratedwait_container_is_ready
. This results in a default wait time of120*120=14400
seconds...As a workaround I set the
testcontainers_config.max_tries
manually: