test/gcp: Run cleanup function at the end

All EXIT traps are cleared on line 280 so the cleanup trap is never run
and VMs are waiting for 4 hours to get cleaned by
scheduled-cloud-cleaner. Run the cleanup at the end and rely on
scheduled-cloud-cleaner only in case of failures before that.
This commit is contained in:
Jakub Rusz 2022-08-25 15:58:14 +02:00 committed by Ondřej Budai
parent efddacc682
commit 5e9ecd3ae4

View file

@ -278,6 +278,8 @@ get_compose_metadata "$COMPOSE_ID"
# Kill the journal monitor immediately and remove the trap
sudo pkill -P ${WORKER_JOURNAL_PID}
trap - EXIT
# trap cleanup again
trap cleanup EXIT
# Did the compose finish with success?
if [[ $COMPOSE_STATUS != FINISHED ]]; then