Fix test: Kill virt-handler only if the VM exist
Sometimes node has qemu process which is defunct.
(probably from previous test)
Therefore we filter out these processes to only match
the incoming domain from migration.
@@ -1785,7 +1785,7 @@ var _ = Describe("[Serial][rfe_id:393][crit:high][vendor:cnv-qe@redhat.com][leve
podName := fmt.Sprintf("migration-killer-pod-%d", idx)
// kill the handler right as we detect the qemu target process come online
- pod := tests.RenderPrivilegedPod(podName, []string{"/bin/bash", "-c"}, []string{fmt.Sprintf("while true; do ps aux | grep \"%s\" && pkill -9 virt-handler && sleep 5; done", emulator)})
+ pod := tests.RenderPrivilegedPod(podName, []string{"/bin/bash", "-c"}, []string{fmt.Sprintf("while true; do ps aux | grep -v \"defunct\" | grep \"%s\" && pkill -9 virt-handler && sleep 5; done", emulator)})
pod.Spec.NodeName = entry.Name
createdPod, err := virtClient.CoreV1().Pods(util.NamespaceTestDefault).Create(context.Background(), pod, metav1.CreateOptions{})
