Skip to content

Commit

Permalink
test: Harden rollingupdate-kubernetes-cr-test.sh
Browse files Browse the repository at this point in the history
* failing in CI
* I think it should wait for ready, not only running
  • Loading branch information
patriknw committed Dec 5, 2023
1 parent 2f8598c commit 25a6c05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions integration-test/scripts/rollingupdate-kubernetes-cr-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ kubectl apply -f $CRD
kubectl -n $NAMESPACE delete deployment akka-rollingupdate-demo || true
kubectl -n $NAMESPACE apply -f $DEPLOYMENT

for i in {1..10}
for i in {1..20}
do
echo "Waiting for pods to get ready..."
kubectl get pods -n $NAMESPACE
[ `kubectl get pods -n $NAMESPACE | grep Running | wc -l` -eq 3 ] && break
phase=$(kubectl get pods -o jsonpath="{.items[*].status.phase}" -n $NAMESPACE)
status=$(kubectl get pods -o jsonpath="{.items[*].status.containerStatuses[*].ready}" -n $NAMESPACE)
if [ "$phase" == "Running Running Running" ] && [ "$status" == "true true true" ]
then
break
fi
sleep 4
done

if [ $i -eq 10 ]
if [ $i -eq 20 ]
then
echo "Pods did not get ready"
kubectl -n $NAMESPACE describe deployment akka-rollingupdate-demo
Expand Down
11 changes: 8 additions & 3 deletions integration-test/scripts/rollingupdate-kubernetes-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ kubectl create namespace $NAMESPACE || true
kubectl -n $NAMESPACE delete deployment akka-rollingupdate-demo || true
kubectl -n $NAMESPACE apply -f $DEPLOYMENT

for i in {1..10}
for i in {1..20}
do
echo "Waiting for pods to get ready..."
kubectl get pods -n $NAMESPACE
[ `kubectl get pods -n $NAMESPACE | grep Running | wc -l` -eq 3 ] && break
phase=$(kubectl get pods -o jsonpath="{.items[*].status.phase}" -n $NAMESPACE)
status=$(kubectl get pods -o jsonpath="{.items[*].status.containerStatuses[*].ready}" -n $NAMESPACE)
if [ "$phase" == "Running Running Running" ] && [ "$status" == "true true true" ]
then
break
fi
sleep 4
done

if [ $i -eq 10 ]
if [ $i -eq 20 ]
then
echo "Pods did not get ready"
kubectl -n $NAMESPACE describe deployment akka-rollingupdate-demo
Expand Down

0 comments on commit 25a6c05

Please sign in to comment.