The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Fix flaky trigger metadata sync test (#79771)
Ben Grabowc5e7d8024ae2
diff --git a/test/metabase/warehouse_schema_rest/api/table_test.clj b/test/metabase/warehouse_schema_rest/api/table_test.cljindex 1a399364fa1..d5758b18148 100644--- a/test/metabase/warehouse_schema_rest/api/table_test.clj+++ b/test/metabase/warehouse_schema_rest/api/table_test.clj@@ -22,6 +22,7 @@[metabase.upload.core :as upload][metabase.upload.impl-test :as upload-test][metabase.util :as u]+ [metabase.util.quick-task :as quick-task][metabase.warehouse-schema-rest.api.table :as api.table][toucan2.core :as t2]))@@ -1276,7 +1277,10 @@(mt/with-premium-features #{:audit-app}(mt/with-temp [:model/Database {db-id :id} {:engine "h2", :details (:details (mt/db))}:model/Table table {:db_id db-id :schema "PUBLIC"}]- (with-redefs [sync/sync-table! (deliver-when-tbl sync-called? table)]+ ;; `with-redefs` would restore `sync-table!` when the request returns, before the async sync runs.+ ;; `submit-task!` is stubbed so the sync doesn't queue behind other tasks on the 1-thread executor.+ (mt/with-dynamic-fn-redefs [quick-task/submit-task! future-call+ sync/sync-table! (deliver-when-tbl sync-called? table)](mt/user-http-request :crowberto :post 200 (format "table/%d/sync_schema" (u/the-id table))))))(testing "sync called?"(is (true?