File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
src/main/groovy/com/avast/gradle/dockercompose Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class ComposeExtension {
1919 boolean waitForTcpPorts = true
2020 Duration waitAfterTcpProbeFailure = Duration . ofSeconds(1 )
2121 Duration waitForTcpPortsTimeout = Duration . ofMinutes(15 )
22- Duration waitForTcpPortsDisconnection = Duration . ofMillis(1000 )
22+ Duration waitForTcpPortsDisconnectionProbeTimeout = Duration . ofMillis(1000 )
2323 Duration waitAfterHealthyStateProbeFailure = Duration . ofSeconds(5 )
2424 Duration waitForHealthyStateTimeout = Duration . ofMinutes(15 )
2525 List<String > useComposeFiles = []
Original file line number Diff line number Diff line change @@ -193,12 +193,11 @@ class ComposeUp extends DefaultTask {
193193 while (true ) {
194194 try {
195195 def s = new Socket (service. host, forwardedPort)
196- s. setSoTimeout(1 )
196+ s. setSoTimeout(extension . waitForTcpPortsDisconnectionProbeTimeout . toMillis() as int )
197197 try {
198198 // in case of Windows and Mac, we must ensure that the socket is not disconnected immediately
199199 // if the socket is closed then it returns -1
200- // if the socket is not closed then returns a data or timeouts (the timeout is set to 1ms)
201- Thread . sleep(extension. waitForTcpPortsDisconnection. toMillis())
200+ // if the socket is not closed then returns a data or timeouts
202201 boolean disconnected = false
203202 try {
204203 disconnected = s. inputStream. read() == -1
You can’t perform that action at this time.
0 commit comments