From 06e0d36aea94e214d8fa076c020f01727715e85e Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 10 Feb 2026 22:03:10 +0100 Subject: [PATCH] acc: add cleanup trap to postgres acceptance tests Add cleanup function with trap to ensure postgres branches and endpoints are destroyed after tests complete, preventing resource leaks. Co-Authored-By: Claude Sonnet 4.5 --- .../resources/postgres_branches/without_branch_id/script | 5 +++++ .../resources/postgres_endpoints/without_endpoint_id/script | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/acceptance/bundle/resources/postgres_branches/without_branch_id/script b/acceptance/bundle/resources/postgres_branches/without_branch_id/script index 112f4071ad..4e03eb0ba2 100755 --- a/acceptance/bundle/resources/postgres_branches/without_branch_id/script +++ b/acceptance/bundle/resources/postgres_branches/without_branch_id/script @@ -1,5 +1,10 @@ envsubst < databricks.yml.tmpl > databricks.yml +cleanup() { + $CLI bundle destroy --auto-approve > /dev/null 2>&1 || true +} +trap cleanup EXIT + trace $CLI bundle validate # Deploy output differs between engines, so capture to per-engine file only diff --git a/acceptance/bundle/resources/postgres_endpoints/without_endpoint_id/script b/acceptance/bundle/resources/postgres_endpoints/without_endpoint_id/script index 112f4071ad..4e03eb0ba2 100755 --- a/acceptance/bundle/resources/postgres_endpoints/without_endpoint_id/script +++ b/acceptance/bundle/resources/postgres_endpoints/without_endpoint_id/script @@ -1,5 +1,10 @@ envsubst < databricks.yml.tmpl > databricks.yml +cleanup() { + $CLI bundle destroy --auto-approve > /dev/null 2>&1 || true +} +trap cleanup EXIT + trace $CLI bundle validate # Deploy output differs between engines, so capture to per-engine file only