Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Stop aborting Redshift test runs on concurrent schema-drop races (GDGT-2126) (#72441)

Ngoc Khuat10997b109084
diff --git a/modules/drivers/redshift/test/metabase/test/data/redshift.clj b/modules/drivers/redshift/test/metabase/test/data/redshift.clj
index 3975e5113fa..3534a0d2486 100644
--- a/modules/drivers/redshift/test/metabase/test/data/redshift.clj
+++ b/modules/drivers/redshift/test/metabase/test/data/redshift.clj
@@ -225,7 +225,6 @@
{expired-isolation :expired} (classify-isolation-schemas conn isolation)
drop-sql (fn [schema-name] (format "DROP SCHEMA IF EXISTS \"%s\" CASCADE;" schema-name))]
(with-open [stmt (.createStatement conn)]
- ;; Drop schemas first
(doseq [[collection fmt-str] [[old-convention "Dropping old data schema: %s"]
[expired "Dropping expired cache schema: %s"]
[lacking-created-at "Dropping cache without created-at info: %s"]
@@ -233,7 +232,10 @@
[expired-isolation "Dropping expired workspace isolation schema: %s"]]
schema collection]
(log/infof fmt-str schema)
- (.execute stmt (drop-sql schema))))))
+ (try
+ (.execute stmt (drop-sql schema))
+ (catch Throwable e
+ (log/infof "Failed to drop %s, skipping: %s" schema (ex-message e))))))))
(defn- create-session-schema! [^java.sql.Connection conn]
(with-open [stmt (.createStatement conn)]