test/cases: properly kill journal for installers.sh

CI gets stuck if we don't kill the journal watcher on exit.
See bc1a7dc30c for more info.
This commit is contained in:
Jakub Rusz 2022-01-18 09:47:58 +01:00 committed by Sanne Raymaekers
parent 35fd20c0de
commit 98f5623914

View file

@ -166,6 +166,8 @@ build_image() {
WORKER_UNIT=$(sudo systemctl list-units | grep -o -E "osbuild.*worker.*\.service")
sudo journalctl -af -n 1 -u "${WORKER_UNIT}" &
WORKER_JOURNAL_PID=$!
# Stop watching the worker journal when exiting.
trap 'sudo pkill -P ${WORKER_JOURNAL_PID}' EXIT
# Start the compose.
greenprint "🚀 Starting compose"
@ -206,8 +208,9 @@ build_image() {
exit 1
fi
# Stop watching the worker journal.
# Kill the journal monitor immediately and remove the trap
sudo pkill -P ${WORKER_JOURNAL_PID}
trap - EXIT
}
# Wait for the ssh server up to be.