Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(redis): port race #2694

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Contributor 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
Contributor 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.

}

genericContainerReq := testcontainers.GenericContainerRequest{
Expand Down
Loading