From: Alfredo Deza Date: Tue, 27 Mar 2018 13:50:28 +0000 (-0400) Subject: ceph-volume tests create a retry script for vagrant reload X-Git-Tag: v12.2.5~116^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=15ed240226ab9b853f16cfcb90e490aa82ddb9a7;p=ceph.git ceph-volume tests create a retry script for vagrant reload Signed-off-by: Alfredo Deza (cherry picked from commit 3be723d4d9816e6b487681d686f87cf41f67abd0) --- diff --git a/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_reload.sh b/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_reload.sh new file mode 100644 index 000000000000..3211b066df07 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_reload.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# vagrant-libvirt has a common behavior where it times out when "reloading" vms. Instead +# of calling `vagrant reload` attempt to halt everything, and then start everything, which gives +# this script the ability to try the `vagrant up` again in case of failure +# + +vagrant halt +# This should not really be needed, but in case of a possible race condition between halt +# and up, it might improve things +sleep 5 + + +retries=0 +until [ $retries -ge 5 ] +do + echo "Attempting to start VMs. Attempts: $retries" + timeout 10m vagrant up "$@" && break + retries=$[$retries+1] + sleep 5 +done