Skip to content

Don't re-use reaper if it failed to initialize#258

Closed
kernle32dll wants to merge 3 commits intotestcontainers:mainfrom
kernle32dll:master
Closed

Don't re-use reaper if it failed to initialize#258
kernle32dll wants to merge 3 commits intotestcontainers:mainfrom
kernle32dll:master

Conversation

@kernle32dll
Copy link
Copy Markdown

If the reaper fails to initialize, it leaves testcontainers in a broken state. To be precise, the Endpoint variable is never properly initialized, which causes subsequent usages of testcontainers to fail with failed to create container: connecting to reaper failed: Connecting to Ryuk on failed: dial tcp: missing address.


c, err := provider.RunContainer(ctx, req)
if err != nil {
reaper = nil
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kernle32dll, thanks for taking the effort of reporting this!

I see this PR would work although I'm concerned about its maintainability if new code conditions are added in the future.

How would you see delaying the creation of the Reaper struct instance (L51) until the container and the endpoint are created (right before the old L87)? I'd see the code more maintainable in this case. wdyt?

@mdelapenya
Copy link
Copy Markdown
Member

@kernle32dll are you still interested in this PR? If not, I'd like to label it as hacktoberfest in case anybody is willing to help here.

@mdelapenya mdelapenya requested a review from a team as a code owner November 28, 2022 09:43
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 24, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit c0f2feb
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/63d01ff03c73cf00085c0d34
😎 Deploy Preview https://deploy-preview-258--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.

@mdonkers
Copy link
Copy Markdown
Contributor

With merging #782, I believe this PR became obsolete and can be closed?

@mdelapenya
Copy link
Copy Markdown
Member

I believe so. I'm closing it but feel free to reopen if it persists, thanks!

@mdelapenya mdelapenya closed this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants