From 1e1eb50330b178951aea6489ee9cbe01b9c76bee Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Wed, 29 Jan 2025 10:54:50 +0000 Subject: [PATCH] ci: Clean up potentially leftover state in case job was cancelled Happened in https://buildkite.com/materialize/nightly/builds/10992#0194ae51-f610-4440-84f7-84fb30f17361 The usual cleanup logic can't be run even though it's in a `finally` block in our Python test code. The `pre-exit` hook is still being run. --- ci/plugins/mzcompose/hooks/pre-exit | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/plugins/mzcompose/hooks/pre-exit b/ci/plugins/mzcompose/hooks/pre-exit index 37f8a29cb3317..25daab73409a6 100755 --- a/ci/plugins/mzcompose/hooks/pre-exit +++ b/ci/plugins/mzcompose/hooks/pre-exit @@ -145,3 +145,7 @@ ci_unimportant_heading ":docker: Cleaning up after mzcompose" run kill || true run rm --force -v run down --volumes + +ci_unimportant_heading "terraform: Destroying leftover state in case job was cancelled or timed out..." +bin/ci-builder run stable terraform -chdir=test/terraform/aws destroy || true +bin/ci-builder run stable terraform -chdir=test/terraform/gcp destroy || true