change external port check to it can timeout and retry#4680
Merged
kiview merged 2 commits intotestcontainers:masterfrom Nov 17, 2021
Merged
change external port check to it can timeout and retry#4680kiview merged 2 commits intotestcontainers:masterfrom
kiview merged 2 commits intotestcontainers:masterfrom
Conversation
kiview
approved these changes
Nov 17, 2021
Member
kiview
left a comment
There was a problem hiding this comment.
LGTM, thanks a lot for the PR @kmcgovern-apixio!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
testcontainers version: 1.16.2
Java version: 1.8
Docker version: 20.10.6 (via minikube)
When trying to use the kafka container module i get the following error when attempting to use it.
doing some testing locally with netcat while the test was hanging i was able to connect fine. i was also able to connect fine using the debugger in intellij. Initially i was able to work-around the issue by using the
MinimumDurationRunningStartupCheckStrategystartup check but wasn't wanting to use that long-term. After looking at the way the check was implemented I thought just adding a socket timeout toExternalPortListeningCheckwould be the appropriate place. After adding a socket timeout to the connection and doing some debugging i saw the connection attempt retry and succeed the second time.If fix doesn't work for you or there's some other way to avoid this issue please let me know.