Skip to content

Commit 119627f

Browse files
authored
Fix await during DockerClientProviderStrategy test method (#9412)
1 parent 8a50d01 commit 119627f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.net.InetSocketAddress;
3232
import java.net.Socket;
3333
import java.net.SocketAddress;
34-
import java.net.SocketTimeoutException;
3534
import java.net.URI;
3635
import java.security.KeyManagementException;
3736
import java.security.KeyStoreException;
@@ -207,14 +206,12 @@ protected boolean test() {
207206
}
208207

209208
try (Socket socket = socketProvider.call()) {
210-
Duration timeout = Duration.ofMillis(200);
211209
Awaitility
212210
.await()
213-
.atMost(TestcontainersConfiguration.getInstance().getClientPingTimeout(), TimeUnit.SECONDS)
214-
.pollInterval(timeout)
211+
.atMost(TestcontainersConfiguration.getInstance().getClientPingTimeout(), TimeUnit.SECONDS) // timeout after configured duration
212+
.pollInterval(Duration.ofMillis(200)) // check state every 200ms
215213
.pollDelay(Duration.ofSeconds(0)) // start checking immediately
216-
.ignoreExceptionsInstanceOf(SocketTimeoutException.class)
217-
.untilAsserted(() -> socket.connect(socketAddress, (int) timeout.toMillis()));
214+
.untilAsserted(() -> socket.connect(socketAddress));
218215
return true;
219216
} catch (Exception e) {
220217
log.warn("DOCKER_HOST {} is not listening", dockerHost, e);

0 commit comments

Comments
 (0)