gitlab CI: handling killing the qemu process better

If qemu has already shut down by the time we call kill, pgrep returns nothing
and we fail the script. Let's not do that. And let's replace kill pgrep with
just pkill in the process.

Let's get rid of the after_script part too, gitlab kills any process started
in the main script anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-02-19 08:42:15 +10:00 committed by Benjamin Tissoires
parent 337ab84599
commit 1954523309

View file

@ -509,17 +509,12 @@ freebsd:11.2@container-clean:
- ssh localhost -p 5555 halt || true
- sleep 2
- kill $(pgrep qemu)
- pkill qemu || true
- if [[ ! -e .success ]] ;
then
exit 1 ;
fi
after_script:
# no matter the results of the tests, we want to kill the VM
- kill $(pgrep qemu)
artifacts:
name: "qemu-meson-logs-$CI_JOB_NAME"
when: always