A simple way to test this is to run wait_for_port.sh
against localhost on a random unused port:
$ .ci/wait_for_port.sh localhost 12345
.....
Then in another shell, listen on that port:
$ nc -l 12345
... and watch how wait_for_port.sh exits beautifully in the first shell:
$ .ci/wait_for_port.sh localhost 12345
................Connection to localhost port 12345 [tcp/italk] succeeded!
OK
This can be quite handy for example when orchestrating CI :-)