[PATCH] D144024: Fix test hang if curl is not installed

Pavel Kosov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 04:30:36 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rLNTd7fc7bf4d584: Fix test hang if curl is not installed (authored by kpdev42).

Repository:
  rLNT LNT

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144024/new/

https://reviews.llvm.org/D144024

Files:
  tests/SharedInputs/server_wrapper.sh


Index: tests/SharedInputs/server_wrapper.sh
===================================================================
--- tests/SharedInputs/server_wrapper.sh
+++ tests/SharedInputs/server_wrapper.sh
@@ -39,6 +39,13 @@
     lnt runserver ${server_instance} --hostname localhost --port ${port_number} >& ${server_instance}/server_wrapper_runserver.log &
     local pid=$!
 
+    # In the polling code below, absence of 'curl' would cause an infinite loop
+    # instead of "command not found" error, so check for environment
+    # misconfiguration explicitly.
+    if ! curl --version > /dev/null; then
+        echo 1>&2 "Command 'curl' not found."
+        exit 1
+    fi
     # Poll the server until it is up and running
     while ! curl http://localhost:${port_number}/ping -m1 -o/dev/null -s ; do
         # Maybe server is totally dead.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144024.503731.patch
Type: text/x-patch
Size: 838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230309/c9a53b6c/attachment.bin>


More information about the llvm-commits mailing list