]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Don’t wait forever for output from script(1)
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 7 Nov 2020 18:53:23 +0000 (19:53 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 9 Nov 2020 07:53:56 +0000 (08:53 +0100)
test/suites/color_diagnostics.bash

index 3aa5eadc1a1fbf618e7c2597945e5f93e83c94d0..85f972a9678d9ff5167da2250c47d5ce66d158e4 100644 (file)
@@ -77,8 +77,10 @@ color_diagnostics_run_on_pty() {
     # script returns early on some platforms (leaving a child process living for
     # a short while) and the output may therefore still be pending. Work around
     # this by sleeping until the output file has content.
-    while [ ! -s "$1" ]; do
+    retries=0
+    while [ ! -s "$1" -a "$retries" -lt 100 ]; do
         sleep 0.1
+        retries=$((retries + 1))
     done
 }