testcontainers / testcontainers-go

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
https://golang.testcontainers.org
MIT License
3.53k stars 482 forks source link

Log retried errors #2613

Closed ash2k closed 2 months ago

ash2k commented 3 months ago

What does this PR do?

Add logging of errors that are retried.

Why is it important?

I want to see any unexpected errors when they happen. Otherwise nothing is logged and the test appears to be stuck forever.

Related issues

netlify[bot] commented 3 months ago

Deploy Preview for testcontainers-go ready!

Name Link
Latest commit f5adf1dbb59bcaf3ecb21ef2a93a7caba3c5de7c
Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/6686b8ff23116800080bca44
Deploy Preview https://deploy-preview-2613--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 configuration.

mdelapenya commented 3 months ago

Could you please update this PR with the changes in #2606 🙏

Thanks!

ash2k commented 3 months ago

Rebased

ash2k commented 3 months ago

Tests are failing with:

  2024/07/02 23:11:31 Failed to pull image: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit, will retry
mdelapenya commented 3 months ago

Rebased

I'm sorry but I do not see the changes for the lifecycle.go function, adding a retry for checking all exposed ports are already available.

ash2k commented 3 months ago

Hm, I've just checked and I think all commits are there:

Am I missing something?

mdelapenya commented 3 months ago

Oh sorry, I probably did not explain myself very well. I asked you to check (and update if neeeded) the retry added in #2606, to include the RetryNotify pattern this PR introduces 🙏

ash2k commented 3 months ago

Ah, ok. Done!