-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Error "Wait for message .... in logs for container" happens sometimes but not always #247
Comments
I managed to reproduce the issue with the following piece of code:
When running
And after a few minutes the C# application starts throwing errors:
Here I mapped some of the ContainerId's from the C# Exceptions to the |
Small additional questions, what's the easiest way to forward the docker logs to a |
Thanks for the nice digging you've done!! :) - I will also have a look at this during coming weekend. What is the output in the console - it should be Cheers, |
@mariotoffia I see no other output in the console. (I run this from a normal console application): |
@mariotoffia Hey, I don't want to push too much on this but I was wondering if you'd already managed to find some time to look at this issue :)? |
@mariotoffia , I was wondering if you'd already had some time to look into this. |
@devedse Sorry, I haven't had the time to do this and not in a forseeable future - but I'll add it to my backlog. |
ok, I just ran into this now.. sometimes WaitForLogMessage works and sometimes it does not, and checking the container logs reveals the expected message is there, and the timestamp shows that it is well before my timeout for the log to appear so it should have been fine. Until this is reliable, we will switch our integration tests back to just polling with a SQL statement for 30 seconds after starting the container... (spinning up a SQL server container in this instance) |
I'm currently writing integration tests for my project. But what I'm running into is that these sometimes fail.
The error that pops up is that it can't find the configured log line in the containers messages.
My configuration:
I've been debugging this problem for the last few hours now and have basically copied the "WaitForMessageInLogs" method in my own source code so that I could debug what's going on.
The problem seems to be that this line seems to return an empty list of strings sometimes:
I added some additional logging information so that I could figure out what's going on: (Logging in Xunit is stupidly hard so I simply expanded the exception message):
This showed the following output:
As you can see the Actual logs field seems to be empty.
Again because I simply couldn't get Xunit to print Console messages I added the
Beepje();
method to start beeping when the exception occurred (😄) so that I knew when something was going wrong.After that I immediately did a
docker log ....
on all running containers and by some quick typing was able to grab the docker container logs before the container exited. Here's the logs:As you can see we do in fact have logs including the message that the
database system is ready to accept connections
.I don't understand why but it seems that sometimes the logs aren't being streamed correctly into FluentDocker. It could possibly have something to do with running multiple containers in parallel but I'm honestly lost.
The text was updated successfully, but these errors were encountered: