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
fix: proper lifecycle for following logs using consumers #366
Conversation
* fix the doc: `c.FollowOutput()` MUST be called before `c.StartLogProducer()` due to date race * do not allow multiple `c.StartLogProducer()` without calling a `c.StopLogProducer()` * run `c.StopLogProducer()` in `c.Terminate()` to reduce risk of an accidental goroutine leak * fix tests, write new tests
Hey @slsyy there is one failing test on CI: https://github.com/testcontainers/testcontainers-go/runs/3875582882?check_suite_focus=true Can you check? 🙏 |
@mdelapenya I will try in the weekend. Perhaps problem is somewhere in the |
Interesting, maybe we can open a separate issue, or a discussion to improve that logic.
Again interesting, could you please provide more info in an issue so we can trace and try to resolve it if possible? 🙏 |
@slsyy I'd like to start the review of this PR but I see merge conflicts on it. Would you mind resolving it? 🙏 Thanks! |
* main: (335 commits) chore: reduce concurrent builds (testcontainers#702) chore: add mysql example (testcontainers#700) chore(deps): bump google.golang.org/api from 0.104.0 to 0.105.0 (testcontainers#699) chore(deps): bump google.golang.org/api in /examples/firestore (testcontainers#683) chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#688) chore(deps): bump google.golang.org/api in /examples/pubsub (testcontainers#685) chore(deps): bump google.golang.org/api in /examples/spanner (testcontainers#684) chore(deps): bump google.golang.org/grpc in /examples/firestore (testcontainers#686) chore(deps): bump google.golang.org/api in /examples/bigtable (testcontainers#680) chore(deps): bump google.golang.org/api in /examples/datastore (testcontainers#678) chore(deps): bump golang.org/x/text from 0.3.7 to 0.5.0 (testcontainers#660) chore(deps): bump github.com/magiconair/properties from 1.8.6 to 1.8.7 (testcontainers#677) chore: postgres example (testcontainers#674) Add bigtable example (testcontainers#676) chore(deps): bump github.com/containerd/containerd from 1.6.10 to 1.6.12 (testcontainers#675) chore: run go mod tidy in examples (testcontainers#672) Improve datastore, firestore, pubsub and spanner tests (testcontainers#670) chore: group dependabot updates (testcontainers#668) chore: update mkdocs format to go-yaml v3 (testcontainers#667) chore: generate dependabot configs for examples (testcontainers#654) ...
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@slsyy I went ahead and resolved the conflicts myself on top of your commits. Do you mind adding a review to verify if your initial intention is not modified? Thanks in advance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Kudos, SonarCloud Quality Gate passed! |
c.FollowOutput()
MUST be called beforec.StartLogProducer()
due to date racec.StartLogProducer()
without calling ac.StopLogProducer()
c.StopLogProducer()
inc.Terminate()
to reduce risk of anaccidental goroutine leak