-
-
Notifications
You must be signed in to change notification settings - Fork 515
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: fix leaking logs #2912
base: main
Are you sure you want to change the base?
bug: fix leaking logs #2912
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @KenxinKun thanks for the fix. I'd go with the default |
I'm wondering if this is another case for where having the default |
Indeed, that's what I think too. @KenxinKun if we change this PR to avoid a custom logger for the wait strategy, using the library's built-in (and to be changed soon) logging infra, then this would be ready to merge. Thanks! |
Sure no problem it makes sense, I'll try to change it tomorrow. I'm not at my laptop to check now, but I recall having an import circular dependency importing from the parent |
Yeah as I suspected the |
Morning! So I just tried briefly to untangle this but there's a significant number of uses of the Thoughts:
Let me know your thoughts @mdelapenya and @stevenh before I make further changes |
@KenxinKun sorry for making you going in circles with the wait and core packages 🤦 Indeed, the core uses wait so not possible. What you suggested about having a logger makes sense, and we do have it in our backlog for an eventual v1 work, please see https://github.com/orgs/testcontainers/projects/13/views/1?filterQuery=log&pane=issue&itemId=87805987. If you're interested in helping out with that, please let us know, as @stevenh would like to tackle the work on a more consistent logger, and you could collaborate in doing that. |
Sure happy to help, we use this library so much! |
@mdelapenya @stevenh apologies I had a crazy last month but I have time now to collaborate on that centralised logger, how should I proceed to work on v1? Just pull the latest v1 tag on a new PR or do we need a side chat first? |
Busy here too, so not had much time to work on Open Source this month. What I need to do is flesh out some protoypes to see how client, logging and other components tie together. |
@stevenh cool just let me know what you need :) |
@KenxinKun @stevenh, also busy here at the moment with conferences, will be back to routine next week. In any case, super proud of your humble contributions, thank you both. @KenxinKun please disregard fetching the v1 branch, it's there for reference of what we want to achieve, but that branch is not up-to-date anymore, so take it as this: "some" of the things in that branch could land into main, but started from main. Said that, if you can work on the central logger, let's start from main/scratch. And feel free you both to talk on what to work next, on our Slack, on a GH discussion for a design doc, or I can even setup a sync zoom/slack session for initial coordination before the async work. Whatever works. |
Sure can you add me to the Slack workspace @mdelapenya ? (email on my profile is good) |
What does this PR do?
Adds a new non-breaking option
func (hp *HostPortStrategy) WithLogger(logger Logging) *HostPortStrategy
.Why is it important?
The linked issue identified leaking logs when waiting for exposed/listening ports. The proposed implementation preserves the current behaviour when not providing the option.
Related issues
How to test this PR
New unit tests are included using mock implementations of the logger interface.
Follow-ups
Consider if the proposed implementation aligns well with the current designs for a centralised logger. I could not import the
testcontainers.Logging
interface due to circular import dependencies, so I had to define a local targeted interface.