Test suite: improve wait_until_node_has_status()
authorMartin Schwenke <martin@meltin.net>
Thu, 12 Aug 2010 03:48:33 +0000 (13:48 +1000)
committerMartin Schwenke <martin@meltin.net>
Thu, 12 Aug 2010 03:48:33 +0000 (13:48 +1000)
This currently does "onnode any ... wait_until ...".  If ctdbd is
being shutdown on a node then that node might be chosen anyway, if it
is asked early enough.  Then we'll loop on that node but our ctdb
client command may always fail, causing a timeout rather than the
expected behaviour.

This puts the loop on the outside of the "onnode any" so that if the
"wrong" node is chosen initially then on the next iteration the choice
can be remade.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/scripts/ctdb_test_functions.bash

index 42053c0486a740ee80d44f42aaa4ac573618b25d..fae49473ccb0ef450e6cb4fabaa7513cce3e44fd 100644 (file)
@@ -437,7 +437,7 @@ wait_until_node_has_status ()
 
     echo "Waiting until node $pnn has status \"$status\"..."
 
-    if ! onnode any $CTDB_TEST_WRAPPER wait_until $timeout node_has_status "$pnn" "$status" ; then
+    if ! wait_until $timeout onnode any $CTDB_TEST_WRAPPER node_has_status "$pnn" "$status" ; then
        for i in "onnode -q any ctdb status" "onnode -q any onnode all ctdb scriptstatus" ; do
            echo "$i"
            $i || true