Skip to content

Commit d7fc7bf

Browse files
committed
Fix test hang if curl is not installed
Indicate environment misconfiguration explicitly: error out if 'curl' is not found instead of silently hanging in an infinite loop. Reviewed By: cmatthews Differential Revision: https://reviews.llvm.org/D144024
1 parent 2edc480 commit d7fc7bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/SharedInputs/server_wrapper.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ main() {
3939
lnt runserver ${server_instance} --hostname localhost --port ${port_number} >& ${server_instance}/server_wrapper_runserver.log &
4040
local pid=$!
4141

42+
# In the polling code below, absence of 'curl' would cause an infinite loop
43+
# instead of "command not found" error, so check for environment
44+
# misconfiguration explicitly.
45+
if ! curl --version > /dev/null; then
46+
echo 1>&2 "Command 'curl' not found."
47+
exit 1
48+
fi
4249
# Poll the server until it is up and running
4350
while ! curl http://localhost:${port_number}/ping -m1 -o/dev/null -s ; do
4451
# Maybe server is totally dead.

0 commit comments

Comments
 (0)