Skip to content

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

Ignore flaky sync failures caused by table deletion race conditions (#81073)

Ben Grabow245862781f42
diff --git a/test/metabase/test/data/impl/get_or_create.clj b/test/metabase/test/data/impl/get_or_create.clj
index 37150edddcd..74ab09d309b 100644
--- a/test/metabase/test/data/impl/get_or_create.clj
+++ b/test/metabase/test/data/impl/get_or_create.clj
@@ -298,11 +298,11 @@
(if full-sync? "Sync" "QUICK sync") driver database-name reference-duration)
;; only do "quick sync" for non `test-data` datasets, because it can take literally MINUTES on CI.
;;
- ;; MEGA SUPER HACK !!! I'm experimenting with this so Redshift tests stop being so flaky on CI! It seems like
- ;; if we ever delete a table sometimes Redshift still thinks it's there for a bit and sync can fail because it
- ;; tries to sync a Table that is gone! So enable normal resilient sync behavior for Redshift tests to fix the
- ;; flakes. If this fixes things I'll try to come up with a more robust solution. -- Cam 2024-07-19. See #45874
- (binding [sync-util/*log-exceptions-and-continue?* (= driver :redshift)]
+ ;; `*log-exceptions-and-continue?*` is true in production; pinning it false here makes one bad table fail
+ ;; the whole test database setup, which is what we want for drivers whose table listing is authoritative.
+ ;; Redshift and BigQuery list tables from metadata that lags the tables themselves, so a table dropped by
+ ;; a concurrent CI job can still appear in the listing and then 404 when sync reads it.
+ (binding [sync-util/*log-exceptions-and-continue?* (contains? #{:redshift :bigquery-cloud-sdk} driver)]
(sync/sync-database! db {:scan scan}))
;; add extra metadata for fields
(try