Skip to content

Commit

Permalink
test/includes/microcloud: poll less aggressively in 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 17, 2024
1 parent e775dc8 commit 43efe18
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 @@ -1054,20 +1054,20 @@ lxd_wait_vm() {
name="${1}"

echo "==> ${name} Awaiting VM..."
for round in $(seq 640); do
for round in $(seq 160); do
if lxc info "${name}" | grep -qF "Status: 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 % 180))" = 0 ]; then
if [ "$((round % 45))" = 0 ]; then
echo "==> ${name} Timeout (${round}s): Re-initializing VM"
lxc restart "${name}" --force
fi

sleep 1
sleep 4
done

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

0 comments on commit 43efe18

Please sign in to comment.