From 25a6c0519aeca5d8c8029642114892607f526df5 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Tue, 5 Dec 2023 14:22:48 +0100 Subject: [PATCH] test: Harden rollingupdate-kubernetes-cr-test.sh * failing in CI * I think it should wait for ready, not only running --- .../scripts/rollingupdate-kubernetes-cr-test.sh | 11 ++++++++--- .../scripts/rollingupdate-kubernetes-test.sh | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh b/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh index 37d518e74..593736034 100755 --- a/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh +++ b/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh @@ -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 diff --git a/integration-test/scripts/rollingupdate-kubernetes-test.sh b/integration-test/scripts/rollingupdate-kubernetes-test.sh index b5f2fdb45..40fa9434d 100755 --- a/integration-test/scripts/rollingupdate-kubernetes-test.sh +++ b/integration-test/scripts/rollingupdate-kubernetes-test.sh @@ -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