fix: await during DockerClientProviderStrategy test method #9412
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.
Current behavior
The current test method performs the following socket test:
testcontainers-java/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java
Lines 209 to 223 in e35705b
Using the config
client.ping.timeout
Consider the following scenario where I set
client.ping.timeout=60
because my docker host and local machine are in different locales and I expect a network lag.Currently, the
client.ping.timeout
configuration is essentially ignored because the socket will always timeout beforeatMost
is ever reached.Proposed Behavior
Instead, we should not provide a timeout to socket.connect.
If we take the same example as previously mentioned:
If the
client.ping.timeout
is reached, then Awaitility will interrupt the Runnable and still throw a ConditionTimeoutException.