-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
[Bug]: Container hangs waiting for startup due to logs #1035
Comments
I cannot reproduce it with the latest version, nor can I find any release notes (changes) that may be causing an issue here. It appears that you are using an older Docker Engine version (20.10). Could you please try the latest version, 24.0?
Collecting the logs is implemented in a straightforward manner. There isn't anything particularly special about what we do here. We set the log filter to min-max (by default) and then get the logs from the container. |
I think I've found the cause of the issue. testcontainers-dotnet/src/Testcontainers/Clients/TestcontainersClient.cs Lines 99 to 118 in 082eea4
For some reason any negative value in this parameter leads to getting no logs at all. With Since = 0 all logs are fetched just fine. Here's a code snippet that replaces the default WaitUntil and shows what works and what doesn't:
|
Docker 24 didn't change this behaviour:
|
BTW I'm not 100% sure if this is mapped as-is but the docker CLI also complains about negative values:
|
Indeed 🤔 a negative value looks wrong. I do not remember why I choose |
Testcontainers version
3.5.0
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
x86
.NET version
6.0.414
Docker version
Docker info
What happened?
Sample code from https://dotnet.testcontainers.org/modules/postgres/ hangs. I've stepped through it and it turns out that somehow the Testcontainers lib can't get the container logs, they all come back as an empty string even though I can view them with
docker logs
.Here's a trivial example. If you override the default wait strategy that checks for logs it doesn't hang (I'm aware that checking only for the port is incorrect).
Seems to be some breaking change in docker?
I tried starting the container directly with Docker.DotNet and I was able to get the logs just fine though...
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: