From 57ae3c6098c35256ab1e3679f77ed28b5aad982a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 19 Oct 2019 19:42:40 +0100 Subject: [PATCH 4/4] tests/test-captive.sh: Better test for pidfile. This test was still unstable on slower machines. Improve the test for the pidfile to make it more stable. Fixes commit 740f6dee658ee6adb356d9600e2b51bb22dbce1e and commit 38165d0f8f5a4eb898d756a561811c2fe042fe4d. --- tests/test-captive.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test-captive.sh b/tests/test-captive.sh index 22a90ca..82697a5 100755 --- a/tests/test-captive.sh +++ b/tests/test-captive.sh @@ -72,10 +72,13 @@ fi # Check that nbdkit death from unhandled signal affects exit status status=0 nbdkit -U - -P captive.pid example1 --run ' -test ! -s captive.pid || sleep 5 -if test ! -s captive.pid; then - echo "no pidfile yet" - exit 10 +for i in {1..60}; do + if test -s captive.pid; then break; fi + sleep 1 +done +if ! test -s captive.pid; then + echo "$0: no pidfile yet" + exit 10 fi kill -s ABRT $(cat captive.pid) || exit 10 sleep 5 -- 2.23.0