Merge pull request #11027 from edsantiago/bats

Networking test: fix silent breakage
This commit is contained in:
OpenShift Merge Robot
2021-07-23 04:15:14 -04:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ load helpers
$IMAGE nc -l -n -v -p $myport $IMAGE nc -l -n -v -p $myport
cid="$output" cid="$output"
wait_for_port 127.0.0.1 $myport wait_for_output "listening on .*:$myport .*" $cid
# emit random string, and check it # emit random string, and check it
teststring=$(random_string 30) teststring=$(random_string 30)

View File

@ -288,7 +288,7 @@ function wait_for_port() {
# Wait # Wait
while [ $_timeout -gt 0 ]; do while [ $_timeout -gt 0 ]; do
{ exec 3<> /dev/tcp/$host/$port; } &>/dev/null && return { exec 5<> /dev/tcp/$host/$port; } &>/dev/null && return
sleep 1 sleep 1
_timeout=$(( $_timeout - 1 )) _timeout=$(( $_timeout - 1 ))
done done