Skip to content

Commit

Permalink
Add sleeps to automation/create_workloads.sh (#202)
Browse files Browse the repository at this point in the history
The e2e test fails from time to time, waiting for vmi that was not
created yet.

This PR changes the script so it will retry reading the vmi before
waiting for it to be ready.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
  • Loading branch information
nunnatsa authored Nov 2, 2023
1 parent fa030df commit f6ceb2f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion automation/create_workloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,23 @@ done

# wait for the execution of the first 5 VMs
for ns in {001..005}; do
${CMD} wait -n "ns${ns}" vmi "testvm-ns${ns}-vm001" --for condition=Ready --timeout="300s"
found=false
for tries in {1..5}; do
if ${CMD} get -n "ns${ns}" vmi "testvm-ns${ns}-vm001"; then
found=true
break
else
echo "vmi ns${ns}/testvm-ns${ns}-vm001 does not exist yet. waiting 10 second"
sleep 10
fi
done

if [[ $found != "true" ]]; then
echo "vmi ns${ns}/testvm-ns${ns}-vm001 was not created"
exit 1
fi

${CMD} wait -n "ns${ns}" vmi "testvm-ns${ns}-vm001" --for condition=Ready --timeout=300s
done

${CMD} get vmis --all-namespaces
Expand Down

0 comments on commit f6ceb2f

Please sign in to comment.