ctdb-tests: Wait for ctdb_eventd to start, fail if it doesn't
authorMartin Schwenke <martin@meltin.net>
Wed, 25 Oct 2017 07:52:10 +0000 (18:52 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 26 Oct 2017 07:35:25 +0000 (09:35 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/eventd/scripts/local.sh

index 343205ecec4b531aaf9cff79d76df62149c900ff..c8f7775f554843db09870241ad3651ae3f718f0e 100644 (file)
@@ -42,7 +42,7 @@ cleanup_eventd ()
 
 setup_eventd ()
 {
-       debug "Setting up eventd"
+       echo "Setting up eventd"
 
        if [ -n "$1" ]; then
                extra_args="-D $1"
@@ -53,9 +53,8 @@ setup_eventd ()
                -e "$eventd_scriptdir" \
                -l "file:" -d "DEBUG" $extra_args 2>&1 | tee "$eventd_logfile" &
        # Wait till eventd is running
-       while [ ! -S "$eventd_socket" ] ; do
-               sleep 1
-       done
+       wait_until 10 test -S "$eventd_socket" || \
+               die "ctdb_eventd failed to start"
 
        test_cleanup cleanup_eventd
 }