Check restarts in self-healing-advanced test
@@ -10,20 +10,27 @@ cluster="self-healing-advanced"
pumba_all_pods() {
local action=$1
+ restartsBefore=$(kubectl get pod self-healing-advanced-pxc-0 -o yaml | grep restartCount: | awk '{print $2}')
# run chaos for Pod
for i in $(seq 1 5); do
run_pumba $action "re2:$cluster-pxc-[0-9]+_"
done
+
sleep 60
- kubectl_bin get pods \
- | grep $cluster-pxc- \
- | grep CrashLoopBackOff
+ restartsAfter=$(kubectl get pod self-healing-advanced-pxc-0 -o yaml | grep restartCount: | awk '{print $2}')
+
+ # check if pod was restarted
+ if [ $restartsAfter -eq $restartsBefore ] ; then
+ exit 1
+ fi
cat_config "$test_dir/conf/$cluster.yml" \
| sed -e 's/forceUnsafeBootstrap: false/forceUnsafeBootstrap: true/' \
| kubectl_bin apply -f-
- kubectl_bin delete pod self-healing-advanced-pxc-0 self-healing-advanced-pxc-1 self-healing-advanced-pxc-2
+ kubectl_bin delete pod self-healing-advanced-pxc-0 self-healing-advanced-pxc-1 self-healing-advanced-pxc-2 --grace-period=0 --force
+
+ sleep 10
# check if all 3 Pods started
wait_for_running $cluster-pxc 3
