change external port check to it can timeout and retry #4680
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
MinimumDurationRunningStartupCheckStrategy
startup 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 toExternalPortListeningCheck
would 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.