From 05d81ffc5d36b8e10c82406a22d8cb7008da2838 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Mon, 19 Aug 2019 17:41:46 -0700 Subject: [PATCH] clean up zombie procs before starting integration tests --- hack/jenkins/common.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index 8e0c7c0b2..8905fd0bd 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -125,6 +125,18 @@ for stale_dir in ${TEST_ROOT}/*; do rmdir "${stale_dir}" || true done + +# sometimes tests left over zombie procs that won't exit +# for example: +# jenkins 20041 0.0 0.0 0 0 ? Z Aug19 0:00 [minikube-linux-] +zombie_defuncts=$(ps -A -ostat,ppid | awk '/[zZ]/ && !a[$2]++ {print $2}C') +if [[ "${zombie_defuncts}" != "" ]]; then + echo "Found zombie defunct procs to kill..." + ps -f -p ${kprocs} || true + sudo -E kill ${kprocs} || true +fi + + if type -P virsh; then virsh -c qemu:///system list --all virsh -c qemu:///system list --all \ -- GitLab