Skip to content

Commit

Permalink
sleep for 20 sec after apiserver outage
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed Feb 6, 2024
1 parent ba9d1e0 commit 985831e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/e2e/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,8 @@ KIND_NODE=$(kind get nodes --name=substratus-test)
docker exec ${KIND_NODE} iptables -I INPUT -p tcp --dport 6443 -j DROP
sleep 120
docker exec ${KIND_NODE} iptables -D INPUT -p tcp --dport 6443 -j DROP

until kubectl get pods; do
echo "Waiting for apiserver to be back up, waiting for 1 second and trying again"
sleep 1
done
echo "Waiting for K8s to recover from apiserver outage"
sleep 20

# rerun kubectl logs because previous one got killed when apiserver was down
kubectl logs --tail=500 -f deployment/lingo &
Expand All @@ -115,7 +112,7 @@ for i in {1..30}; do
echo "Test failed: Expected 0 replica after not having requests for more than 1 minute, got $replicas"
exit 1
fi
replicas=$(kubectl get deployment stapi-minilm-l6-v2 -o jsonpath='{.spec.replicas}' || true)
replicas=$(kubectl get deployment stapi-minilm-l6-v2 -o jsonpath='{.spec.replicas}')
if [ "$replicas" -eq 0 ]; then
echo "Test passed: Expected 0 replica after not having requests for more than 1 minute"
break
Expand Down

0 comments on commit 985831e

Please sign in to comment.