Skip to content

Commit

Permalink
test/includes/microcloud: tweak lxd_wait_vm()
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Apr 21, 2024
1 parent 553379c commit 34c1624
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions microcloud/test/includes/microcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1073,20 +1073,20 @@ lxd_wait_vm() {
name="${1}"

echo "==> ${name} Awaiting VM..."
for round in $(seq 160); do
for round in $(seq 0 5 150); do
if [ "$(lxc list -f csv -c s "${name}")" = "READY" ] ; then
wait_snapd "${name}"
echo " ${name} VM is ready"
return 0
fi

# Sometimes the VM just won't start, so retry after 3 minutes.
if [ "$((round % 45))" = 0 ]; then
if [ "$((round % 60))" = 0 ]; then
echo "==> ${name} Timeout (${round}s): Re-initializing VM"
lxc restart "${name}" --force
fi

sleep 4
sleep 5
done

echo " ${name} VM failed to start"
Expand Down

0 comments on commit 34c1624

Please sign in to comment.