Skip to content

Commit

Permalink
Add a retry logic when checking the vtgate version
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Nov 19, 2024
1 parent 971ecf5 commit 5744194
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/endtoend/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,18 @@ function insertWithRetry() {

function verifyVtGateVersion() {
version=$1
podName=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep "vtgate")
data=$(kubectl logs "$podName" | head)
echo "$data" | grep "$version" > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo -e "The vtgate version is incorrect, expected: $version, got:\n$data"
exit 1
fi
data=""
for i in {1..600} ; do
podName=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep "vtgate")
data=$(kubectl logs "$podName" | head)
echo "$data" | grep "$version" > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
return
fi
sleep 1
done
echo -e "The vtgate version is incorrect, expected: $version, got:\n$data"
exit 1
}


Expand Down

0 comments on commit 5744194

Please sign in to comment.