From: Joel Rosdahl Date: Sat, 7 Nov 2020 18:53:23 +0000 (+0100) Subject: test: Don’t wait forever for output from script(1) X-Git-Tag: v4.1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cd91f0bbb547d9890788754d2df8bdc3cc341cd;p=thirdparty%2Fccache.git test: Don’t wait forever for output from script(1) --- diff --git a/test/suites/color_diagnostics.bash b/test/suites/color_diagnostics.bash index 3aa5eadc1..85f972a96 100644 --- a/test/suites/color_diagnostics.bash +++ b/test/suites/color_diagnostics.bash @@ -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 }