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

fix(redis): port race #2694

Closed
wants to merge 1 commit into from

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Aug 6, 2024

Fix race condition on port availability by switching to port instead of log check.

Fix race condition on port availability by switching to port instead of
log check.
@stevenh stevenh requested a review from a team as a code owner August 6, 2024 20:32
Copy link

netlify bot commented Aug 6, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 9d424d7
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66b288719243a400081b2b12
😎 Deploy Preview https://deploy-preview-2694--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.

@@ -54,7 +54,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
req := testcontainers.ContainerRequest{
Image: img,
ExposedPorts: []string{"6379/tcp"},
WaitingFor: wait.ForLog("* Ready to accept connections"),
WaitingFor: wait.ForListeningPort("6379/tcp"),
Copy link
Member

Choose a reason for hiding this comment

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

I haven't seen any issue with this wait strategy, which is widely use here and in the java module.

Could you bring more light about the motivation for the change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With all the iterations on the test suite I've had a few cases where test failed due to redis not accept incoming requests.

I didn't dig in fully as with this change, I never saw a reoccurrence. It could be redis reports the log entry early?

Copy link
Member

Choose a reason for hiding this comment

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

I'd keep this wait strategy as is, as it's been used for years. The PR is so simple that we can go back to it whenever it's needed. In #2633 we added a wait for all available ports, but it contains a bug, reported in #2633

I'd close this one because of that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure will keep an eye for a failure.

@stevenh
Copy link
Collaborator Author

stevenh commented Aug 9, 2024

Closing until we get another reproduction of this issue.

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.

2 participants