Skip to content
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

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

Closed
wants to merge 3 commits into from

Conversation

kernle32dll
Copy link

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.

@@ -77,11 +77,13 @@ func NewReaper(ctx context.Context, sessionID string, provider ReaperProvider, r

c, err := provider.RunContainer(ctx, req)
if err != nil {
reaper = nil
Copy link
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
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

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
Contributor

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

@mdelapenya
Copy link
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