testcontainers-go icon indicating copy to clipboard operation
testcontainers-go copied to clipboard

fix: Following Container Logs feature fixes

Open slsyy opened this issue 4 years ago • 4 comments

  • 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

slsyy avatar Oct 12 '21 20:10 slsyy

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 avatar Oct 21 '21 19:10 mdelapenya

@mdelapenya I will try in the weekend. Perhaps problem is somewhere in the StartLogProducer. The logic is so weird, that I need to some time to analyse it: for example we reopen connection every 5 seconds due to usage of ctx, cancel := context.WithTimeout(ctx, time.Second*5), which is weird. Other problem, which I have found during testing in my private project is a CPU usage: StartLogProducer was responsible for ~90%, which also seems weird for such an ancillary operation

slsyy avatar Oct 25 '21 21:10 slsyy

The logic is so weird, that I need to some time to analyse it: for example we reopen connection every 5 seconds due to usage of ctx, cancel := context.WithTimeout(ctx, time.Second*5), which is weird.

Interesting, maybe we can open a separate issue, or a discussion to improve that logic.

Other problem, which I have found during testing in my private project is a CPU usage: StartLogProducer was responsible for ~90%, which also seems weird for such an ancillary operation

Again interesting, could you please provide more info in an issue so we can trace and try to resolve it if possible? 🙏

mdelapenya avatar Oct 26 '21 07:10 mdelapenya

@slsyy I'd like to start the review of this PR but I see merge conflicts on it. Would you mind resolving it? 🙏 Thanks!

mdelapenya avatar Oct 03 '22 15:10 mdelapenya

Deploy Preview for testcontainers-go ready!

Name Link
Latest commit 235797f485ca945c34c644b65eb9b45b08173da2
Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/641b294e388b7f0008313d51
Deploy Preview https://deploy-preview-366--testcontainers-go.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Mar 20 '23 16:03 netlify[bot]

@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

mdelapenya avatar Mar 20 '23 16:03 mdelapenya

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Mar 22 '23 16:03 sonarqubecloud[bot]