From: Martin Schwenke Date: Tue, 29 Oct 2019 04:11:31 +0000 (+1100) Subject: ctdb-tests: No longer retry starting the cluster X-Git-Tag: talloc-2.3.1~139 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b5ed00054e7d1e34cf33706c670e17a188c67d1;p=thirdparty%2Fsamba.git ctdb-tests: No longer retry starting the cluster Retrying like this hides bugs. The cluster should come up first time, every time. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index d5bd542ab00..e36af5f9d51 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -568,26 +568,15 @@ wait_until_node_has_no_ips () ctdb_init () { - local i - for i in $(seq 1 5) ; do ctdb_stop_all >/dev/null 2>&1 || : - ctdb_start_all || { - echo "Start failed. Trying again in a few seconds..." - sleep_for 5 - continue - } - wait_until_ready || { - echo "Cluster didn't become ready. Restarting..." - continue - } + ctdb_start_all || ctdb_test_error "Cluster start failed" + + wait_until_ready || ctdb_test_error "Cluster didn't become ready" echo "Setting RerecoveryTimeout to 1" onnode -pq all "$CTDB setvar RerecoveryTimeout 1" - # In recent versions of CTDB, forcing a recovery like this - # blocks until the recovery is complete. Hopefully this will - # help the cluster to stabilise before a subsequent test. echo "Forcing a recovery..." onnode -q 0 $CTDB recover sleep_for 2 @@ -597,14 +586,8 @@ ctdb_init () wait_until 30/2 onnode -q any $CTDB_TEST_WRAPPER _cluster_is_recovered fi - - # Cluster is still healthy. Good, we're done! if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then - echo "Cluster became UNHEALTHY again [$(date)]" - onnode -p all ctdb status -X 2>&1 - onnode -p all ctdb scriptstatus 2>&1 - echo "Restarting..." - continue + ctdb_test_error "Cluster became UNHEALTHY again [$(date)]" fi echo "Doing a sync..." @@ -612,15 +595,6 @@ ctdb_init () echo "ctdb is ready" return 0 - done - - echo "Cluster UNHEALTHY... too many attempts..." - onnode -p all ctdb status -X 2>&1 - onnode -p all ctdb scriptstatus 2>&1 - - # Try to make the calling test fail - status=1 - return 1 } ctdb_base_show ()