File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
core/src/main/java/org/testcontainers/containers/wait/internal Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 44import org .testcontainers .containers .ContainerState ;
55
66import java .io .IOException ;
7+ import java .net .InetSocketAddress ;
78import java .net .Socket ;
89import java .util .Set ;
910import java .util .concurrent .Callable ;
@@ -21,8 +22,9 @@ public Boolean call() {
2122 String address = containerState .getHost ();
2223
2324 externalLivenessCheckPorts .parallelStream ().forEach (externalPort -> {
24- try {
25- new Socket (address , externalPort ).close ();
25+ try (Socket socket = new Socket ()) {
26+ InetSocketAddress inetSocketAddress = new InetSocketAddress (address , externalPort );
27+ socket .connect (inetSocketAddress , 1000 );
2628 } catch (IOException e ) {
2729 throw new IllegalStateException ("Socket not listening yet: " + externalPort );
2830 }
You can’t perform that action at this time.
0 commit comments