When we are in kill_vm_berfore_test branch the vm is left from pre case. It probably will not shutdown by itself, so the wait_for here is meaningless. Just add gracefully as below lines may enough.