You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to define a log consumer for a GenericContainer, but DockerComposeContainer has a very limited API. The latter allows you to tail the included containers' output, but doesn't provide the means to monitor the output.
That's it, it just redirects the containers' output to the standard output. But what if I need to monitor outout? For instance, my Spring Boot application has Vaadin UI, and it actually fully loads a few seconds later after Spring has announced that app has started and the port is opened now. If I open browser right away via BrowserWebDriverContainer, Vaadin pages do not work properly. So I'd like to wait for appropriate message from Vaadin to start my test.
I think it would be beneficial to allow to define a custom consumer here, or the ability to wait for a certain message to appear in the log (like it's done in GenericContainer).
I have a PR out that addresses exactly this issue. #600
Edit: well, it allows you to wait for log messages on docker-compose.
It doesn't expose the API to to add your own consumer through DockerComposeContainer.
@kiview
I think it should be pretty straightforward to add a withLogConsumer(String service, Consumer<OutputFrame> consumer) method to DockerComposeContainer now after the recent refactoring.
@barrycommins Thx, this would be awesome!
If you encounter any strange race condition like problems while working on logging stuff please tell us, there are still some open issues with LogMessageWaitStrategy missing messages, we couldn't find out yet.
Activity
kshepitko commentedon Mar 13, 2018
Ability to use some wait strategies would be great, too
barrycommins commentedon Mar 14, 2018
Hi @kshepitko,
I have a PR out that addresses exactly this issue. #600
Edit: well, it allows you to wait for log messages on docker-compose.
It doesn't expose the API to to add your own consumer through
DockerComposeContainer.kshepitko commentedon Mar 22, 2018
Thanks for update, @barrycommins !
There's an impressive refactoring you performed there! Thank you for this.
I think that new your feature would be pretty much enough for me.
@kiview Do you think there's still a value in defining the log consumers for DockerCompose-managed containers? If not, I'll close this issue.
kiview commentedon Mar 23, 2018
@kshepitko I think it's still a valuable feature request, if only to give compose the same expected feature set as the regular containers.
barrycommins commentedon Mar 25, 2018
@kiview
I think it should be pretty straightforward to add a
withLogConsumer(String service, Consumer<OutputFrame> consumer)method toDockerComposeContainernow after the recent refactoring.I'm happy to implement it, if you'd like.
kiview commentedon Mar 25, 2018
@barrycommins Thx, this would be awesome!
If you encounter any strange race condition like problems while working on logging stuff please tell us, there are still some open issues with
LogMessageWaitStrategymissing messages, we couldn't find out yet.Added withLogConsumer() method to DockerComposeContainer (#629)