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
Standardize nonparallel tests on ^:synchronized (#80064)
Chris Truter3989cb5eb384
diff --git a/.clj-kondo/src/hooks/clojure/core/ns.clj b/.clj-kondo/src/hooks/clojure/core/ns.cljindex ef54cf0fb9a..338023737f4 100644--- a/.clj-kondo/src/hooks/clojure/core/ns.clj+++ b/.clj-kondo/src/hooks/clojure/core/ns.clj@@ -71,6 +71,24 @@(some-> (ns-form-node->ns-symb-node ns-form-node)hooks/sexpr))+(defn- lint-test-parallel-metadata [ns-form-node]+ (when-let [ns-symb-node (ns-form-node->ns-symb-node ns-form-node)]+ (let [ns-metadata (meta (hooks/sexpr ns-symb-node))]+ (cond+ (:synchronous ns-metadata)+ (hooks/reg-finding!+ (assoc (meta ns-symb-node)+ :message (str "Use `^:synchronized` to mark this namespace explicitly non-parallel; "+ "`^:synchronous` is ignored by Hawk. [:metabase/validate-deftest]")+ :type :metabase/validate-deftest))++ (and (contains? ns-metadata :parallel)+ (false? (:parallel ns-metadata)))+ (hooks/reg-finding!+ (assoc (meta ns-symb-node)+ :message "Use `^:synchronized` instead of `^{:parallel false}`. [:metabase/validate-deftest]"+ :type :metabase/validate-deftest))))))+(defn- lint-modules [ns-form-node config](let [ns-symb (ns-form-node->ns-symb ns-form-node)](when-not (modules/ignored-namespace? config ns-symb)@@ -140,6 +158,7 @@lint-requires-on-new-lines(lint-modules (modules/config x))lint-namespace-name+ lint-test-parallel-metadatalint-jsqlparser-imports)x)diff --git a/.clj-kondo/src/hooks/clojure/test.clj b/.clj-kondo/src/hooks/clojure/test.cljindex b13d977f379..e577f1a696b 100644--- a/.clj-kondo/src/hooks/clojure/test.clj+++ b/.clj-kondo/src/hooks/clojure/test.clj@@ -28,11 +28,11 @@(walk form)))(defn- deftest-check-parallel- "1. Check if test is marked ^:parallel / ^:synchronized correctly.+ "1. Check if test is marked `^:parallel` / `^:synchronized` correctly.2. Make sure disallowed forms are not used in ^:parallel tests.- 3. Disallow ^:parallel tests in namespaces marked ^:synchronous -- the- ns marker is the author's blanket promise that nothing inside runs- in parallel, so an individual ^:parallel deftest contradicts it."+ 3. Disallow `^:parallel` tests in namespaces marked `^:synchronized` --+ the ns marker is the author's blanket promise that nothing inside runs+ in parallel, so an individual `^:parallel` deftest contradicts it."[{[_ test-name & body] :children, :as _node} ns-sym config](let [test-metadata (:meta test-name)metadata-sexprs (map hooks/sexpr test-metadata)@@ -44,28 +44,48 @@(completing merge){}metadata-sexprs)- parallel? (:parallel combined-metadata)- synchronized? (:synchronized combined-metadata)- ns-synchronous? (boolean (:synchronous (meta ns-sym)))]+ parallel? (true? (:parallel combined-metadata))+ synchronized? (true? (:synchronized combined-metadata))+ explicitly-nonparallel? (or synchronized?+ (and (contains? combined-metadata :parallel)+ (false? (:parallel combined-metadata))))+ ns-metadata (meta ns-sym)+ ns-explicitly-nonparallel? (or (true? (:synchronized ns-metadata))+ (and (contains? ns-metadata :parallel)+ (false? (:parallel ns-metadata))))]+ (when (and (contains? combined-metadata :parallel)+ (false? (:parallel combined-metadata)))+ (hooks/reg-finding! (assoc (meta test-name)+ :message (str "Use `^:synchronized` instead of `^{:parallel false}`. "+ "[:metabase/validate-deftest]")+ :type :metabase/validate-deftest)))+ (when (:sequential combined-metadata)+ (hooks/reg-finding! (assoc (meta test-name)+ :message (str "Use `^:synchronized` to mark this test explicitly non-parallel; "+ "`^:sequential` is ignored by Hawk. "+ "[:metabase/validate-deftest]")+ :type :metabase/validate-deftest)))(when (and parallel? synchronized?)(hooks/reg-finding! (assoc (meta test-name)- :message "Test should not be marked both ^:parallel and ^:synchronized"+ :message "Test should not be marked both `^:parallel` and `^:synchronized`":type :metabase/validate-deftest)))- (when (and parallel? ns-synchronous?)+ (when (and parallel? ns-explicitly-nonparallel?)(hooks/reg-finding!(assoc (meta test-name)- :message (str "Test should not be marked ^:parallel in a namespace marked ^:synchronous -- "+ :message (str "Test should not be marked `^:parallel` in a namespace marked "+ "`^:synchronized` -- ""the ns marker promises no parallel execution. "- "Drop ^:parallel from the deftest, or drop ^:synchronous from the ns. "+ "Drop `^:parallel` from the deftest, or drop `^:synchronized` from the ns. ""[:metabase/validate-deftest]"):type :metabase/validate-deftest)))- ;; only when the custom `:metabase/deftest-not-marked-parallel-or-synchronized` is enabled: complain if tests are- ;; not explicitly marked `^:parallel` or `^:synchronized`. This is mostly to encourage people to mark everything- ;; `^:parallel` in places like `metabase.lib` tests unless there is a really good reason not to.- (when-not (or parallel? synchronized?)+ ;; Only when the custom `:metabase/deftest-not-marked-parallel-or-synchronized` is enabled:+ ;; complain if tests are not explicitly marked `^:parallel` or `^:synchronized`. This is+ ;; mostly to encourage people to mark everything `^:parallel` in places like `metabase.lib`+ ;; tests unless there is a really good reason not to.+ (when-not (or parallel? explicitly-nonparallel?)(hooks/reg-finding!(assoc (meta test-name)- :message "Test should be marked either ^:parallel or ^:synchronized"+ :message "Test should be marked either `^:parallel` or `^:synchronized`":type :metabase/deftest-not-marked-parallel-or-synchronized)))(when parallel?(doseq [form body]@@ -233,18 +253,20 @@(defn use-fixtures"Flag `:parallel/unsafe` forms inside fixtures. Skipped when the surrounding- namespace is marked `^:synchronous` -- the ns marker is the author's+ namespace is marked `^:synchronized` -- the ns marker is the author'sexplicit opt-in to a single-threaded test ns where destructive setup issafe. Without that opt-in, kondo can't know whether sibling deftests willbe `^:parallel`, so the conservative default is to flag.Sister to [[deftest-check-parallel]]: the deftest hook rejects `^:parallel`- tests inside a `^:synchronous` ns, so the two checks together form a- coherent opt-in: either the whole ns is synchronous (fixtures can be+ tests inside a `^:synchronized` ns, so the two checks together form a+ coherent opt-in: either the whole ns is explicitly non-parallel (fixtures can beanything; no parallel tests allowed) or it isn't (fixtures must beparallel-safe)."[{:keys [node config], ns-sym :ns, :as input}]- (when-not (:synchronous (meta ns-sym))+ (when-not (or (true? (:synchronized (meta ns-sym)))+ (and (contains? (meta ns-sym) :parallel)+ (false? (:parallel (meta ns-sym)))))(let [linter-config (get-in config [:linters :metabase/validate-deftest])](doseq [form (rest (:children node))](warn-about-disallowed-parallel-forms form linter-config))))diff --git a/.clj-kondo/test/hooks/clojure/core/ns_test.clj b/.clj-kondo/test/hooks/clojure/core/ns_test.cljindex 1a370553b8b..64fabf76932 100644--- a/.clj-kondo/test/hooks/clojure/core/ns_test.clj+++ b/.clj-kondo/test/hooks/clojure/core/ns_test.clj@@ -19,6 +19,19 @@(defn- lint-modules [form config](lint-ns form (assoc-in config [:linters :metabase/modules :level] :warning)))+(deftest ^:parallel explicit-nonparallel-namespace-metadata-test+ (let [config {:linters {:metabase/validate-deftest {:level :warning}}}]+ (testing "Hawk's supported namespace marker passes"+ (is (empty? (lint-ns '(ns ^:synchronized example.test) config))))+ (testing "the verbose Hawk spelling is not accepted as Metabase style"+ (is (=? [{:type :metabase/validate-deftest+ :message #(re-find #"Use `\^:synchronized` instead" %)}]+ (lint-ns '(ns ^{:parallel false} example.test) config))))+ (testing "the legacy marker explains that Hawk ignores it"+ (is (=? [{:type :metabase/validate-deftest+ :message #(re-find #"`\^:synchronous` is ignored by Hawk" %)}]+ (lint-ns '(ns ^:synchronous example.test) config))))))+(deftest ^:parallel module-checker-allowed-modules-test(are [task-namespace] (=? [{:message "Module task should not be used in the api module. [:metabase/modules api :uses]":type :metabase/modules}]diff --git a/.clj-kondo/test/hooks/clojure/test_test.clj b/.clj-kondo/test/hooks/clojure/test_test.cljindex bcd487a1c90..777f0b58f28 100644--- a/.clj-kondo/test/hooks/clojure/test_test.clj+++ b/.clj-kondo/test/hooks/clojure/test_test.clj@@ -21,6 +21,54 @@#{:athena}}}}})(mapv :message @(:findings clj-kondo.impl.utils/*ctx*))))+(defn- parallel-metadata-findings+ ([form]+ (parallel-metadata-findings form 'example.test))+ ([form ns-sym]+ (let [linters {:metabase/deftest-not-marked-parallel-or-synchronized {:level :warning}+ :metabase/validate-deftest {:level :warning}}]+ (binding [clj-kondo.impl.utils/*ctx* {:config {:linters linters}+ :ignores (atom nil)+ :findings (atom [])+ :namespaces (atom {})}]+ (hooks.clojure.test/deftest {:node (api/parse-string form)+ :lang :clj+ :ns ns-sym+ :config {:linters {:metabase/validate-deftest {}}}})+ @(:findings clj-kondo.impl.utils/*ctx*)))))++(deftest ^:parallel explicit-nonparallel-metadata-test+ (testing "Hawk's supported test markers satisfy the explicit metadata linter"+ (are [metadata] (empty? (parallel-metadata-findings+ (format "(deftest %s example-test (is true))" metadata)))+ "^:parallel"+ "^:synchronized"))+ (testing "an unmarked test still gets the opt-in linter's guidance"+ (is (=? [{:type :metabase/deftest-not-marked-parallel-or-synchronized+ :message "Test should be marked either `^:parallel` or `^:synchronized`"}]+ (parallel-metadata-findings "(deftest example-test (is true))"))))+ (testing "the unsupported marker explains that Hawk ignores it"+ (is (some #(and (= (:type %) :metabase/validate-deftest)+ (re-find #"ignored by Hawk" (:message %)))+ (parallel-metadata-findings+ "(deftest ^:sequential example-test (is true))"))))+ (testing "the verbose Hawk spelling is not accepted as Metabase style"+ (is (some #(and (= (:type %) :metabase/validate-deftest)+ (re-find #"Use `\^:synchronized` instead" (:message %)))+ (parallel-metadata-findings+ "(deftest ^{:parallel false} example-test (is true))"))))+ (testing "a test cannot request both execution modes"+ (is (some #(and (= (:type %) :metabase/validate-deftest)+ (re-find #"both `\^:parallel` and `\^:synchronized`" (:message %)))+ (parallel-metadata-findings+ "(deftest ^:parallel ^:synchronized example-test (is true))"))))+ (testing "a namespace-level non-parallel promise rejects parallel tests"+ (is (=? [{:type :metabase/validate-deftest+ :message #(re-find #"namespace marked.*`\^:synchronized`" %)}]+ (parallel-metadata-findings+ "(deftest ^:parallel example-test (is true))"+ (with-meta 'example.test {:synchronized true}))))))+(deftest ^:parallel disallow-hardcoded-driver-names-in-tests-test(is (= [](deftest-warningsdiff --git a/deps.edn b/deps.ednindex ff8a8d9403d..88cb6f32127 100644--- a/deps.edn+++ b/deps.edn@@ -267,7 +267,7 @@djblue/portal {:mvn/version "0.62.0"} ; ui for inspecting valuesintegrant/integrant {:mvn/version "1.0.1"} ; component lifecycle managementio.github.camsaul/humane-are {:mvn/version "1.0.2"} ; cleaner test output- io.github.metabase/hawk {:mvn/version "1.0.18"} ; test runner+ io.github.metabase/hawk {:mvn/version "1.0.19"} ; test runnerio.opentelemetry/opentelemetry-sdk-testing {:mvn/version "1.54.1"} ; InMemorySpanExporter for tracing tests; matches sdk impl (clj-otel-sdk 0.2.10 → 1.54.1); api is separately pinned to 1.62.0io.zonky.test/embedded-postgres {:mvn/version "2.2.2"} ; In-process postgres for dev and testing;; Native postgres binaries for every OS/arch we're likely to run on in@@ -491,7 +491,7 @@cider/piggieback {:mvn/version "0.6.1"}cljs-bean/cljs-bean {:mvn/version "1.9.0"}com.lambdaisland/glogi {:mvn/version "1.3.169"}- io.github.metabase/hawk {:mvn/version "1.0.18"}+ io.github.metabase/hawk {:mvn/version "1.0.19"}org.clojars.mmb90/cljs-cache {:mvn/version "0.1.4"}org.clojure/clojurescript {:mvn/version "1.12.134"}refactor-nrepl/refactor-nrepl {:mvn/version "3.11.0"}diff --git a/enterprise/backend/test/metabase_enterprise/advanced_config/file/api_keys_test.clj b/enterprise/backend/test/metabase_enterprise/advanced_config/file/api_keys_test.cljindex db1e8dd2b88..3cf63e889cb 100644--- a/enterprise/backend/test/metabase_enterprise/advanced_config/file/api_keys_test.clj+++ b/enterprise/backend/test/metabase_enterprise/advanced_config/file/api_keys_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.advanced-config.file.api-keys-test+(ns ^:synchronized metabase-enterprise.advanced-config.file.api-keys-test(:require[clojure.test :refer :all][metabase-enterprise.advanced-config.file :as config.file]diff --git a/enterprise/backend/test/metabase_enterprise/cloud_add_ons/api_test.clj b/enterprise/backend/test/metabase_enterprise/cloud_add_ons/api_test.cljindex c365a3b5ba7..187c8748ed2 100644--- a/enterprise/backend/test/metabase_enterprise/cloud_add_ons/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/cloud_add_ons/api_test.clj@@ -7,7 +7,7 @@[metabase.premium-features.core :as premium-features][metabase.test :as mt]))-(deftest ^:sequential post-product-type-test+(deftest ^:synchronized post-product-type-test(testing "POST /api/ee/cloud-add-ons/metabase-ai"(testing "requires superuser"(mt/with-premium-features #{}@@ -71,7 +71,7 @@(is (= (mt/user->id :crowberto) user_id))(is (= {:add-on {:product-type "metabase-ai"}} details)))))))))))-(deftest ^:sequential post-transforms-test+(deftest ^:synchronized post-transforms-test(doseq [[product-type feature] [["python-execution" :transforms-python]["transforms" :transforms-basic]["transforms-basic" :transforms-basic]@@ -97,7 +97,7 @@(is (=? {}(mt/user-http-request :crowberto :post 200 (str "ee/cloud-add-ons/" product-type) {})))))))))-(deftest ^:sequential post-dwh-rent-test+(deftest ^:synchronized post-dwh-rent-test(testing "POST /api/ee/cloud-add-ons/dwh-rent"(testing "requires superuser"(mt/with-premium-features #{}@@ -138,7 +138,7 @@{:product-type "etl-connections" :prepaid-units 1}]}details))))))))))-(deftest ^:sequential post-etl-connections-test+(deftest ^:synchronized post-etl-connections-test(testing "POST /api/ee/cloud-add-ons/etl-connections"(testing "requires superuser"(mt/with-premium-features #{}@@ -153,7 +153,7 @@(is (empty? @store-api-calls)"Store API was not called")))))))-(deftest ^:sequential delete-product-type-test+(deftest ^:synchronized delete-product-type-test(testing "DELETE /api/ee/cloud-add-ons/metabase-ai-managed"(testing "requires superuser"(mt/with-premium-features #{}@@ -192,7 +192,7 @@(is (not-empty @clear-token-cache-calls)"Token cache was cleared"))))))))-(deftest ^:sequential delete-dwh-rent-test+(deftest ^:synchronized delete-dwh-rent-test(testing "DELETE /api/ee/cloud-add-ons/dwh-rent"(testing "requires superuser"(mt/with-premium-features #{}@@ -219,7 +219,7 @@(is (not-empty @clear-token-cache-calls)"Token cache was cleared")))))))-(deftest ^:sequential delete-etl-connections-test+(deftest ^:synchronized delete-etl-connections-test(testing "DELETE /api/ee/cloud-add-ons/etl-connections"(testing "requires superuser"(mt/with-premium-features #{}@@ -234,7 +234,7 @@(is (empty? @store-api-calls)"Store API was not called")))))))-(deftest ^:sequential get-plans-test+(deftest ^:synchronized get-plans-test(testing "GET /api/ee/cloud-add-ons/plans"(testing "requires superuser"(mt/with-premium-features #{}@@ -264,7 +264,7 @@(is (=? (:body plan-data)(mt/user-http-request :crowberto :get 200 "ee/cloud-add-ons/plans"))))))))))-(deftest ^:sequential get-addons-test+(deftest ^:synchronized get-addons-test(testing "GET /api/ee/cloud-add-ons/addons"(testing "requires superuser"(mt/with-premium-features #{}diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.cljindex 91783fa1e36..1c47ffab8b2 100644--- a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.custom-viz-plugin.api-test+(ns ^:synchronized metabase-enterprise.custom-viz-plugin.api-test(:require[clj-http.client :as http][clojure.string :as str]diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.cljindex 10933347ab0..4a64e212abe 100644--- a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.clj+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.custom-viz-plugin.cache-test+(ns ^:synchronized metabase-enterprise.custom-viz-plugin.cache-test(:require[clj-http.client :as http][clojure.test :refer :all]diff --git a/enterprise/backend/test/metabase_enterprise/data_complexity_score/api_test.clj b/enterprise/backend/test/metabase_enterprise/data_complexity_score/api_test.cljindex 7ba01567d4f..ec24f4bbd49 100644--- a/enterprise/backend/test/metabase_enterprise/data_complexity_score/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/data_complexity_score/api_test.clj@@ -138,7 +138,7 @@(is (= ["api-test-fp" "appdb" sample-score] @persisted?)"API recompute path must stamp source=\"appdb\"")))))-(deftest ^:sequential complexity-endpoint-force-recalculation-advances-last-fingerprint-on-snowplow-publish-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-advances-last-fingerprint-on-snowplow-publish-test(testing "force recalculation mirrors the scheduled path's fingerprint gate — advance only when Snowplow accepted the event"(mt/with-temporary-setting-values [data-complexity-scoring-last-fingerprint "stale"](mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})@@ -152,7 +152,7 @@(is (= "refresh-fp" (data-complexity-score.settings/data-complexity-scoring-last-fingerprint))"successful Snowplow publish must advance the last-fingerprint so the next boot doesn't redundantly re-score")))))-(deftest ^:sequential complexity-endpoint-force-recalculation-keeps-fingerprint-stale-when-snowplow-publish-fails-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-keeps-fingerprint-stale-when-snowplow-publish-fails-test(testing "force recalculation leaves the fingerprint stale when Snowplow didn't accept the event, so the next scheduled run retries"(mt/with-temporary-setting-values [data-complexity-scoring-last-fingerprint "stale"](mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})@@ -176,7 +176,7 @@(is (= (expected-response sample-score)(mt/user-http-request :crowberto :get 200 endpoint :force-recalculation true)))))))-(deftest ^:sequential complexity-endpoint-force-recalculation-superuser-gets-consistent-totals-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-superuser-gets-consistent-totals-test(testing "check invariants not covered by schema";; Stub the synonym-source's opts to a deterministic hash-seeded random vector lookup. Returning;; {} would zero out the synonym axis and trivialize the invariants below; calling the real@@ -230,7 +230,7 @@(is (<= syn-pairs max-pairs)(format "%s :synonym_pairs (%s) can't exceed n*(n-1)/2 for n=%s" catalog syn-pairs n-entities)))))))))-(deftest ^:sequential complexity-endpoint-force-recalculation-metabot-catalog-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-metabot-catalog-test(testing ":metabot mirrors :universe when use_verified_content is off";; Pin the setting explicitly instead of relying on test-env defaults — the unfiltered path;; is only exercised when the scope is empty, and we want this assertion to keep passing even@@ -264,7 +264,7 @@(get-in resp [:universe :components :size :components :entity_count :measurement]))":metabot entity-count must be strictly < :universe when curated-only filters out the injected uncurated Card/Table"))))))))-(deftest ^:sequential complexity-endpoint-force-recalculation-metabot-collection-scope-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-metabot-collection-scope-test(testing ":metabot is scoped to the internal Metabot's collection_id subtree (root + descendants)";; Fixture shape — exercises both halves of `metabot-collection-scope-ids`:;; parent ← Metabot's collection_id; holds a Card directly (catches root-omitted regressions)@@ -350,7 +350,7 @@{:library empty-catalog :universe empty-catalog :metabot empty-catalog:meta {:formula-version 1 :format-version 1 :synonym-threshold 0.0}})-(deftest ^:sequential complexity-endpoint-force-recalculation-allows-active-scheduled-claim-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-allows-active-scheduled-claim-test(testing "manual API recalculation does not share the cron/boot scoring claim"(let [active-claim (pr-str {:fingerprint "older-fingerprint":claimed-at (System/currentTimeMillis)@@ -370,7 +370,7 @@"force recalculation should compute independently of scheduled claims")(is (= active-claim (data-complexity-score.settings/data-complexity-scoring-claim))))))))-(deftest ^:sequential complexity-endpoint-force-recalculation-rejects-concurrent-requests-test+(deftest ^:synchronized complexity-endpoint-force-recalculation-rejects-concurrent-requests-test(testing "a second concurrent request fast-fails with 409 instead of running a duplicate scoring pass";; Block the stubbed scoring call on a latch so the second request is guaranteed to land;; while the guard is held. Plain `with-redefs` (not `with-dynamic-fn-redefs`) becausediff --git a/enterprise/backend/test/metabase_enterprise/data_complexity_score/cli_test.clj b/enterprise/backend/test/metabase_enterprise/data_complexity_score/cli_test.cljindex 5252fbe790e..ce8c661aa0c 100644--- a/enterprise/backend/test/metabase_enterprise/data_complexity_score/cli_test.clj+++ b/enterprise/backend/test/metabase_enterprise/data_complexity_score/cli_test.clj@@ -109,7 +109,7 @@(is (= 2 (:field-count events))"events Table should have exactly 2 fields — the side-car must not be counted"))))-(deftest ^:sequential run-cli-writes-readable-json-test+(deftest ^:synchronized run-cli-writes-readable-json-test;; Not ^:parallel: calls `cli/write-result!`, which kondo flags as a destructive function in;; parallel tests. The temp file we hand it is unique-per-call so the write is safe in;; principle, but the lint flag is the right default — drop it instead of whitelisting.@@ -275,7 +275,7 @@(is (true? (:cli-validation (ex-data ex))))(is (re-find #"must be a directory" (ex-message ex)))))))-(deftest ^:sequential main-translates-validation-errors-to-fail-test+(deftest ^:synchronized main-translates-validation-errors-to-fail-test(testing "-main converts ex-info {:cli-validation true} from run-cli into fail! + exit 1"(let [fail-calls (atom [])](mt/with-dynamic-fn-redefs [cli/fail! (fn [& msgs]@@ -286,7 +286,7 @@(is (= 1 (count @fail-calls)) "fail! should be invoked exactly once")(is (re-find #"does not exist" (ffirst @fail-calls))))))-(deftest ^:sequential main-converts-missing-embeddings-to-fail-test+(deftest ^:synchronized main-converts-missing-embeddings-to-fail-test(testing "-main translates a missing --embeddings override into a one-line fail! + exit 1"(let [fail-calls (atom [])](mt/with-dynamic-fn-redefs [cli/fail! (fn [& msgs]@@ -324,7 +324,7 @@(is (true? (:cli-validation (ex-data ex))))(is (re-find #"--source appdb does not accept" (ex-message ex))))))-(deftest ^:sequential run-cli-representation-mode-default-does-not-write-test+(deftest ^:synchronized run-cli-representation-mode-default-does-not-write-test(testing "representation mode with no --write-to-appdb flag never calls record-score! or bootstrap"(let [persisted? (atom false)bootstrapped? (atom false)]@@ -334,7 +334,7 @@(is (false? @persisted?) "representation+no-write must not persist anything")(is (false? @bootstrapped?) "representation+no-write must not boot the appdb at all")))))-(deftest ^:sequential run-cli-representation-mode-with-write-stamps-representation-source-test+(deftest ^:synchronized run-cli-representation-mode-with-write-stamps-representation-source-test(testing "representation + --write-to-appdb true persists a row stamped 'representation:<digest>' and does not advance the cron fingerprint"(let [calls (atom [])advance-calls (atom 0)]@@ -354,7 +354,7 @@(is (zero? @advance-calls)"representation-derived rows must never advance the cron's last-fingerprint setting")))))-(deftest ^:sequential run-cli-appdb-mode-defaults-to-writing-test+(deftest ^:synchronized run-cli-appdb-mode-defaults-to-writing-test(testing "appdb mode with no --write-to-appdb flag defaults to writing (true) but doesn't advance the cron fingerprint";; CLI runs disable Snowplow, so they can't legitimately advance;; `data-complexity-scoring-last-fingerprint` — that setting is the cron's@@ -377,7 +377,7 @@(is (zero? @advance-calls)"CLI must not advance the cron's last-fingerprint setting")))))-(deftest ^:sequential run-cli-appdb-mode-respects-explicit-no-write-test+(deftest ^:synchronized run-cli-appdb-mode-respects-explicit-no-write-test(testing "appdb + --write-to-appdb false scores but never persists"(let [persisted? (atom false)](mt/with-dynamic-fn-redefs [mdb/setup-db-without-migrations! (fn [])@@ -388,7 +388,7 @@(#'cli/run-cli {:source "appdb" :write-to-appdb false})(is (false? @persisted?))))))-(deftest ^:sequential run-cli-appdb-mode-registers-in-process-provider-test+(deftest ^:synchronized run-cli-appdb-mode-registers-in-process-provider-test(testing "appdb mode registers the in-process embedding provider before it scores";; The standalone CLI skips `metabase.core.core/init!`, where the server registers the provider. Without;; this a synonym axis configured for `in-process` fails with `:provider-not-registered`.diff --git a/enterprise/backend/test/metabase_enterprise/data_complexity_score/complexity_test.clj b/enterprise/backend/test/metabase_enterprise/data_complexity_score/complexity_test.cljindex 4ecd37baa6b..a4dcb7e8994 100644--- a/enterprise/backend/test/metabase_enterprise/data_complexity_score/complexity_test.clj+++ b/enterprise/backend/test/metabase_enterprise/data_complexity_score/complexity_test.clj@@ -276,7 +276,7 @@(is (= {:error expected} (synonym-of embedder))(format ":error must be a nonblank string when the throwable's message is %s" label)))))))-(deftest ^:sequential complexity-scores-metabot-scope-opt-test+(deftest ^:synchronized complexity-scores-metabot-scope-opt-test(testing ":curated-only? true flows the caller's metabot-scope through to enumerate-catalogs"(let [captured-scope (atom nil)](mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs@@ -326,7 +326,7 @@(is (= 1.0 (get-in metabot [:components :size :components :entity-count :measurement])))(is (= 2.0 (get-in universe [:components :size :components :entity-count :measurement])))))))))-(deftest ^:sequential metabot-catalog-excludes-hidden-tables-test+(deftest ^:synchronized metabot-catalog-excludes-hidden-tables-test(testing ":metabot tables filter out hidden (`visibility_type` non-nil) and routed-DB tables so thecatalog matches what Metabot/search can actually surface";; Regression: `:metabot` used to count every active non-audit table, which overcounted on@@ -363,7 +363,7 @@(is (not (contains? ids routed))"tables whose db has router_database_id are filtered out"))))))-(deftest ^:sequential metabot-catalog-curated-scope-test+(deftest ^:synchronized metabot-catalog-curated-scope-test(testing "{:curated-only? true} restricts the :metabot catalog to curated Cards AND Tables,mirroring the `curated` filter Metabot search applies when use_verified_content is on"(collections.tu/with-library [{:keys [metrics]}]@@ -417,7 +417,7 @@"curated Cards (verified / official / library) and curated Tables (authoritative /published-final) are in; uncurated entities and hidden tables stay out"))))))-(deftest ^:sequential metabot-collection-scope-ids-test+(deftest ^:synchronized metabot-collection-scope-ids-test(testing "nil collection-id returns nil (no Metabot collection scope configured)"(is (nil? (#'complexity/metabot-collection-scope-ids nil))))(testing "valid collection-id returns the id plus its descendants"@@ -449,7 +449,7 @@"bar" (known-vectors "bar")}result)))))-(deftest ^:sequential library-empty-when-no-library-collection-test+(deftest ^:synchronized library-empty-when-no-library-collection-test(testing "on an instance with no Library collection, the library score is zero and universe still reports"(collections.tu/without-library(mt/with-temp [:model/Database {db-id :id} {:name "No-library Test DB"}@@ -468,7 +468,7 @@(testing "universe still enumerates appdb content (our temp table + whatever else is there)"(is (pos? (:score universe)))))))))-(deftest ^:sequential library-excludes-audit-content-test+(deftest ^:synchronized library-excludes-audit-content-test(testing "published audit-db content in the Library tree is excluded so :library stays a subset of :universe";; Regression: library-entities previously didn't filter on audit/audit-db-id while universe/metabot did.;; An audit card/table placed in the Library could push :library past :universe and break the new@@ -515,7 +515,7 @@(is (= {} (semantic-search/search-index-embedder[(entity :name "orders" :kind :table)])))))-(deftest ^:sequential complexity-scores-with-real-search-index-embedder-test+(deftest ^:synchronized complexity-scores-with-real-search-index-embedder-test(testing "complexity-scores drives the real search-index-embedder + pgvector end-to-end";; Self-gated on MB_PGVECTOR_DB_URL — CI without semantic-search infra skips this;;; locally with pgvector running it exercises the pgvector read path that all other@@ -539,7 +539,7 @@@captured)"embedder returned vectors from pgvector and the synonym axis produced a real measurement")))))-(deftest ^:sequential search-index-embedder-propagates-read-failures-test+(deftest ^:synchronized search-index-embedder-propagates-read-failures-test(testing "pgvector read failures propagate so the caller can flag a degraded synonym axis";; Regression guard: before this, the embedder swallowed read exceptions and returned {}, which;; looked indistinguishable from \"no synonym matches.\" A transient search-index failure@@ -576,7 +576,7 @@(pr-str k) (pr-str @unseen)){:pairs k :remaining @unseen})))))}))-(deftest ^:sequential search-index-embedder-global-dedup-test+(deftest ^:synchronized search-index-embedder-global-dedup-test(testing "global dedup picks lowest numeric model_id regardless of batch boundaries";; Stub at fetch-batch so the real batching path executes. With batch-size 1, each entity;; pair lands in its own SQL batch, so the two duplicates come back from separate partitions@@ -629,7 +629,7 @@(is (empty? @unseen)"every expected fetch-batch pair-set must be requested")))))))-(deftest ^:sequential search-index-embedder-cross-batch-dedup-test+(deftest ^:synchronized search-index-embedder-cross-batch-dedup-test(testing "duplicates split across separate fetch batches are resolved globally";; Mock at fetch-batch so the real partition-all fold executes. With batch-size 1, each entity;; pair lands in its own SQL batch. The stub is keyed by the expected `(model, model_id)`@@ -662,7 +662,7 @@(is (empty? @unseen)"every expected fetch-batch pair-set must be requested")))))))-(deftest ^:sequential search-index-embedder-cross-batch-dedup-test-2+(deftest ^:synchronized search-index-embedder-cross-batch-dedup-test-2(testing "cross-batch, cross-model duplicates: model_id primary, model secondary";; Same normalized name from three different batches and three different model types.;; model_id "5" appears twice (card + dataset); model_id "12" is in a third batch.@@ -713,7 +713,7 @@true? {:mid nil :model_id "abc" :model "card"} {:mid nil :model_id "xyz" :model "card"}false? {:mid nil :model_id "xyz" :model "card"} {:mid nil :model_id "abc" :model "card"})))-(deftest ^:sequential meta-passes-through-caller-supplied-model-and-variant-test+(deftest ^:synchronized meta-passes-through-caller-supplied-model-and-variant-test(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs(constantly {:library [] :universe [] :metabot []})](testing ":embedding-model and :text-variant are published in :meta when the caller passes them"@@ -732,7 +732,7 @@(is (not (contains? meta :embedding-model)))(is (not (contains? meta :text-variant)))))))-(deftest ^:sequential synonym-source-default-opts-pin-minilm-via-ai-service-test+(deftest ^:synchronized synonym-source-default-opts-pin-minilm-via-ai-service-test(testing "at default settings, synonym-source produces the MiniLM-L6-v2 ai-service descriptor + names-split text variant"(test-util/with-synonym-source [](let [{:keys [embedder embedding-model-meta text-variant]} (synonym-source/complexity-scores-opts)]@@ -744,7 +744,7 @@(is (fn? embedder)"synonym-source returns a fresh provider-embedder for the descriptor")))))-(deftest ^:sequential synonym-source-in-process-opts-pin-bundled-minilm-test+(deftest ^:synchronized synonym-source-in-process-opts-pin-bundled-minilm-test(testing "the in-process synonym provider selects the bundled MiniLM model, not Library retrieval's Arctic model"(test-util/with-synonym-source [:provider "in-process"](let [{:keys [embedder embedding-model-meta text-variant]} (synonym-source/complexity-scores-opts)@@ -762,7 +762,7 @@(is (= bundled-minilm @captured)"the embedder asks the provider SPI for the bundled MiniLM model")))))-(deftest ^:sequential provider-embedder-suppresses-token-tracking-test+(deftest ^:synchronized provider-embedder-suppresses-token-tracking-test(testing "provider-embedder always passes :record-tokens? false to get-embeddings-batch";; Complexity scoring isn't user-driven search traffic; the score itself is the analytics;; signal, so embedding calls here shouldn't write to `semantic_search_token_tracking`@@ -782,7 +782,7 @@["orders"])(is (= 384 (:vector-dimensions @captured-translation-model))))-(deftest ^:sequential provider-embedder-splits-names-before-calling-provider-test+(deftest ^:synchronized provider-embedder-splits-names-before-calling-provider-test(testing "provider-embedder splits names on _, -, ., and camelCase before sending to get-embeddings-batch"(let [captured (atom nil)embedder (embedders/provider-embedder {:provider "ai-service" :model-name "fake" :model-dimensions 4})]@@ -801,7 +801,7 @@"metabase v2 foo"]@captured))))))-(deftest ^:sequential provider-embedder-propagates-provider-errors-test+(deftest ^:synchronized provider-embedder-propagates-provider-errors-test(testing "provider errors bubble up so score-synonym-pairs can report nil measurements + :error"(let [embedder (embedders/provider-embedder {:provider "ai-service" :model-name "fake" :model-dimensions 4})](mt/with-dynamic-fn-redefs [embeddings/get-embeddings-batch@@ -809,7 +809,7 @@(is (thrown-with-msg? Throwable #"ai-service down"(embedder [{:id 1 :name "orders" :kind :table}])))))))-(deftest ^:sequential provider-embedder-zips-by-position-test+(deftest ^:synchronized provider-embedder-zips-by-position-test(testing "vectors come back keyed by the normalized name; nil slots are dropped"(let [embedder (embedders/provider-embedder {:provider "ai-service" :model-name "fake" :model-dimensions 2})](mt/with-dynamic-fn-redefs [embeddings/get-embeddings-batch@@ -822,7 +822,7 @@(is (= #{"keep me" "another"} (set (keys result))))(is (every? #(instance? (Class/forName "[F") %) (vals result))))))))-(deftest ^:sequential active-embedding-model-reads-from-active-index-test+(deftest ^:synchronized active-embedding-model-reads-from-active-index-test(testing "active-embedding-model returns the model from the active index, not the configured setting"(let [active-model {:provider "openai" :model-name "text-embedding-ada-002" :vector-dimensions 1536}](mt/with-dynamic-fn-redefs [ss.embedders/try-active-index-state@@ -865,7 +865,7 @@[(str (snake group) "." (snake leaf)) score]))]event))))-(deftest ^:sequential emit-snowplow-publishes-total-and-each-subscore-test+(deftest ^:synchronized emit-snowplow-publishes-total-and-each-subscore-test(testing "one event per (catalog × key) — grand total, group rollups, and leaves — with correct scores"(snowplow-test/with-fake-snowplow-collector(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs@@ -899,7 +899,7 @@(number? (get-in e ["parameters" "synonym_threshold"]))))events))))))))-(deftest ^:sequential emit-snowplow-includes-measurement-for-sub-components-test+(deftest ^:synchronized emit-snowplow-includes-measurement-for-sub-components-test(testing "each leaf event carries the raw pre-score measurement; totals and group-totals do not"(snowplow-test/with-fake-snowplow-collector;; Library: 3 entities, one collision pair, 5 fields total.@@ -926,7 +926,7 @@(is (= 0.0 (get-in by-key ["ambiguity.synonym_pairs" "measurement"])))(is (= 0.0 (get-in by-key ["ambiguity.repeated_measures" "measurement"])))))))))-(deftest ^:sequential emit-snowplow-cascades-nil-on-embedder-failure-test+(deftest ^:synchronized emit-snowplow-cascades-nil-on-embedder-failure-test(testing "embedder failure cascades nil through aggregates without skipping any events"(snowplow-test/with-fake-snowplow-collector(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs@@ -954,7 +954,7 @@;; when ambiguity falls through. Catches a regression where the cascade goes too far.(is (number? (get-in by-key ["size.total" "score"])))))))))-(deftest ^:sequential emit-snowplow-truncates-error-to-schema-max-test+(deftest ^:synchronized emit-snowplow-truncates-error-to-schema-max-test(testing "a pathologically long exception message is truncated so it doesn't fail schema validation"(snowplow-test/with-fake-snowplow-collector(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs@@ -972,7 +972,7 @@(is (= 1024 (count err))"error is clipped to the schema's maxLength of 1024")))))))-(deftest ^:sequential emit-snowplow-includes-embedding-model-and-text-variant-meta-test+(deftest ^:synchronized emit-snowplow-includes-embedding-model-and-text-variant-meta-test(testing "every event's parameters carry the nested embedding_model + text_variant from synonym-source"(snowplow-test/with-fake-snowplow-collector(mt/with-dynamic-fn-redefs [embeddings/get-embeddings-batch (fn [& _] [])@@ -990,7 +990,7 @@(is (every? #(= expected-model (get-in % ["parameters" "embedding_model"])) events))(is (every? #(= "names_split" (get-in % ["parameters" "text_variant"])) events)))))))-(deftest ^:sequential emit-snowplow-batch-id-test+(deftest ^:synchronized emit-snowplow-batch-id-test(testing "scoring stamps every event with a UUID batch_id, constant within a pass and fresh between passes"(snowplow-test/with-fake-snowplow-collector(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs@@ -1015,7 +1015,7 @@(let [batch-2 (drain-and-check-pass!)](is (not= batch-1 batch-2)))))))))-(deftest ^:sequential emit-snowplow-failure-is-swallowed-test+(deftest ^:synchronized emit-snowplow-failure-is-swallowed-test(testing "emission failure is caught; complexity-scores still returns the score and logs a warning"(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs(constantly {:library [(entity :name "orders")]@@ -1035,7 +1035,7 @@(messages))"a warning about the publish failure was logged"))))))-(deftest ^:sequential complexity-scores-emit-snowplow-false-skips-publish-test+(deftest ^:synchronized complexity-scores-emit-snowplow-false-skips-publish-test(testing ":emit-snowplow? false bypasses Snowplow entirely and stamps ::snowplow-published? false";; Pins the CLI/appdb path: the standalone scorer disables telemetry, so we must not call;; into the analytics tracker at all (catching failures upstream isn't enough — the cost is@@ -1054,7 +1054,7 @@(is (false? (::complexity/snowplow-published? (meta result)))"result metadata reflects that nothing was published"))))))-(deftest ^:sequential complexity-score-library-hermetic-test+(deftest ^:synchronized complexity-score-library-hermetic-test(testing "library score is computed over exactly the Library collection tree — known inputs produce known scores";; The library tree gets a fixed set of tables, fields, measures, and metric cards. One extra;; collection + table + card sit outside the library so the universe is a strict superset.@@ -1168,7 +1168,7 @@:metabot {:score 0 :components {}} :meta {}}{:metabase-enterprise.data-complexity-score.complexity/snowplow-published? published?}))-(deftest ^:sequential latest-score-filters-by-fingerprint-test+(deftest ^:synchronized latest-score-filters-by-fingerprint-test(testing "the overview cache only returns scores matching the current scoring fingerprint"(mt/initialize-if-needed! :db)(let [other-fingerprint "latest-score-test/other"@@ -1184,7 +1184,7 @@(finally(t2/delete! :model/DataComplexityScore :fingerprint [:in [other-fingerprint fingerprint]]))))))-(deftest ^:sequential latest-score-filters-by-source-test+(deftest ^:synchronized latest-score-filters-by-source-test(testing "passing source filters out representation-derived rows that share the cron's fingerprint";; The CLI's representation mode writes under the same `task.complexity-score/current-fingerprint`;; as the cron/API so that an admin re-running the cron after a CLI scoring still benefits from@@ -1206,7 +1206,7 @@(finally(t2/delete! :model/DataComplexityScore :fingerprint fingerprint))))))-(deftest ^:sequential scored-within-cooldown-uses-db-time-test+(deftest ^:synchronized scored-within-cooldown-uses-db-time-test(testing "scored-within-cooldown? counts only same-fingerprint, same-source rows inside the window";; created_at defaults to the DB's current_timestamp, so the cutoff is computed in DB time. We;; seed rows relative to real wall-clock (H2's clock ≈ the JVM's) with 1h/13h offsets — far from@@ -1236,7 +1236,7 @@(finally(t2/delete! :model/DataComplexityScore :fingerprint [:in [fp other]]))))))-(deftest ^:sequential run-scoring-persists-latest-score-snapshot-test+(deftest ^:synchronized run-scoring-persists-latest-score-snapshot-test(testing "every successful computation persists a fresh snapshot for the overview endpoint"(mt/initialize-if-needed! :db)(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})]@@ -1254,7 +1254,7 @@(is (> id before-id)"a new append-only snapshot should be written for each run")))))))))-(deftest ^:sequential run-scoring-advances-fingerprint-only-on-confirmed-publish-test+(deftest ^:synchronized run-scoring-advances-fingerprint-only-on-confirmed-publish-test(testing "fingerprint advances only when Snowplow accepted the event; any other outcome leaves it stale to retry"(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})](testing "successful publish → fingerprint advances to the claim's fingerprint"@@ -1281,7 +1281,7 @@(is (= "stale" (settings/data-complexity-scoring-last-fingerprint))"fingerprint preserved so the next boot / cron retries the failed cache write")))))))-(deftest ^:sequential scoring-gate-matrix-test+(deftest ^:synchronized scoring-gate-matrix-test(testing "scoring runs iff :data-complexity-score premium feature OR deprecated setting is on"(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})](doseq [[label premium-features setting-value should-run?]@@ -1313,7 +1313,7 @@(format "with-scoring-claim! should %sacquire a claim for [%s]"(if should-run? "" "NOT ") label)))))))))))-(deftest ^:sequential maybe-emit-boot-score-only-advances-fingerprint-on-successful-publish-test+(deftest ^:synchronized maybe-emit-boot-score-only-advances-fingerprint-on-successful-publish-test(testing "boot-time emission never advances the last-successful fingerprint on failure — thesuccess fingerprint is separate from the in-progress scoring claim, so a scoring/publishfailure (or a crash mid-run) leaves the fingerprint stale and the next boot retries"@@ -1339,7 +1339,7 @@(is (= "" (settings/data-complexity-scoring-claim))"scoring claim released after successful run")))))))-(deftest ^:sequential maybe-emit-boot-score-claim-protocol-test+(deftest ^:synchronized maybe-emit-boot-score-claim-protocol-test(testing "the shared scoring claim serializes boot-time emission against sibling nodes and cron ticks"(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})](testing "a fresh claim (sibling node or concurrent cron tick) blocks duplicate emission even when last-fp is stale"@@ -1395,7 +1395,7 @@(is (= sibling-claim (settings/data-complexity-scoring-claim))"replacement claim preserved — our release was a compare-and-clear and the owners didn't match"))))))))-(deftest ^:sequential claim-scoring-run-mode-selection-test+(deftest ^:synchronized claim-scoring-run-mode-selection-test(testing "the cron cooldown gate resolves to :skip / :republish / :recompute by publish state"(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})](let [current (#'task.complexity-score/current-fingerprint)]@@ -1420,7 +1420,7 @@(is (=? {:mode :recompute :fingerprint current}(#'task.complexity-score/claim-scoring-run! {:cooldown-hours 12}))))))))))-(deftest ^:sequential republish-cached-score-test+(deftest ^:synchronized republish-cached-score-test(testing "the re-publish path re-emits the cached snapshot without recomputing"(mt/initialize-if-needed! :db)(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})]@@ -1462,7 +1462,7 @@(#'task.complexity-score/republish-cached-score! "missing-fp")(is (true? @recompute?) "a missing snapshot must trigger a recompute"))))))))-(deftest ^:sequential cron-run-claim-path-test+(deftest ^:synchronized cron-run-claim-path-test(testing "the cron path — with-scoring-claim! + run-claim!, exactly what the Quartz job body calls"(mt/initialize-if-needed! :db)(mt/with-dynamic-fn-redefs [metabot-scope/internal-metabot-scope (constantly {})]@@ -1507,7 +1507,7 @@(finally(t2/delete! :model/DataComplexityScore :fingerprint current :source "appdb")))))))))-(deftest ^:sequential publish-tagging-test+(deftest ^:synchronized publish-tagging-test(testing "::snowplow-published? metadata records publish success/failure for schedule/boot callers"(testing "complexity-scores (fresh compute + publish)"(mt/with-dynamic-fn-redefs [complexity/enumerate-catalogs@@ -1544,7 +1544,7 @@(is (false? (::complexity/snowplow-published? (meta result))))(is (= score result) "the score value is returned untouched"))))))))-(deftest ^:sequential republish-from-cached-snapshot-round-trip-test+(deftest ^:synchronized republish-from-cached-snapshot-round-trip-test(testing "the real latest-score → republish-score! → emit-snowplow! round-trip emits events from a cached snapshot"(mt/initialize-if-needed! :db)(let [fingerprint "republish-round-trip-test/fp"diff --git a/enterprise/backend/test/metabase_enterprise/dependencies/api_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/api_test.cljindex 6fb6fee29fe..25b4573367b 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/api_test.clj@@ -225,7 +225,7 @@:edges #{}}(update response :edges set)))))))))))-(deftest ^:sequential table-dependents-all-types-test+(deftest ^:synchronized table-dependents-all-types-test(testing "GET /api/ee/dependencies/graph dependents_count types every non-card dependent kind for a table root"(mt/with-premium-features #{:dependencies :transforms-basic}(mt/with-model-cleanup [:model/Card :model/Dependency :model/DependencyStatus@@ -307,7 +307,7 @@:type "card"}]response))))))))-(deftest ^:sequential dependents-multiple-types-test+(deftest ^:synchronized dependents-multiple-types-test(testing "GET /api/ee/dependencies/graph/dependents with multiple dependent-types"(mt/with-premium-features #{:dependencies}(mt/with-model-cleanup [:model/Card :model/Dependency :model/DependencyStatus :model/DashboardCard]@@ -346,7 +346,7 @@(is (contains? (set (map :type response)) "card"))(is (contains? (set (map :type response)) "dashboard"))))))))))-(deftest ^:sequential dependents-multiple-card-types-test+(deftest ^:synchronized dependents-multiple-card-types-test(testing "GET /api/ee/dependencies/graph/dependents with multiple dependent-card-types"(mt/with-premium-features #{:dependencies}(mt/with-model-cleanup [:model/Card :model/Dependency :model/DependencyStatus]@@ -448,7 +448,7 @@:dependent-types "card")](is (empty? response)))))))))-(deftest ^:sequential dependents-inactive-table-test+(deftest ^:synchronized dependents-inactive-table-test(testing "inactive tables are always included as dependents and in node counts"(mt/with-premium-features #{:dependencies :transforms-basic :hosting}(let [mp (mt/metadata-provider)@@ -484,7 +484,7 @@(:nodes response))](is (= 1 (get-in transform-node [:dependents_count :table]))))))))))-(deftest ^:sequential dependents-broken-parameter-test+(deftest ^:synchronized dependents-broken-parameter-test(testing "GET /api/ee/dependencies/graph/dependents?broken=true - only returns entities that are broken"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -988,7 +988,7 @@(is (= (:id card) (:id (first response))))))))))));; TODO (AlexP 01/15/26) -- fix and unskip this test-#_(deftest ^:sequential graph-archived-measure-in-chain-test+#_(deftest ^:synchronized graph-archived-measure-in-chain-test(testing "GET /api/ee/dependencies/graph when a measure in the chain is archived"(mt/with-premium-features #{:dependencies}(mt/with-model-cleanup [:model/Measure]@@ -1057,7 +1057,7 @@(is (contains? node-ids measure-c-id) "measure C should appear")(is (contains? node-ids products-id) "products table should appear"))))))))-(deftest ^:sequential graph-view-count-test+(deftest ^:synchronized graph-view-count-test(testing "GET /api/ee/dependencies/graph should return :view_count for :card"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User {user-id :id} {}@@ -1092,7 +1092,7 @@:data {:view_count 1}}]}response)))))))-(deftest ^:sequential unreferenced-questions-test+(deftest ^:synchronized unreferenced-questions-test(testing "GET /api/ee/dependencies/unreferenced - only unreferenced questions are returned"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)@@ -1114,7 +1114,7 @@:data {:name "Unreferenced Card - unreftest"}}]}response))))))))-(deftest ^:sequential unreferenced-tables-test+(deftest ^:synchronized unreferenced-tables-test(testing "GET /api/ee/dependencies/unreferenced - only unreferenced tables are returned"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)]@@ -1131,7 +1131,7 @@:data {:name "Unreferenced Table - unreftest"}}]}response))))))))-(deftest ^:sequential unreferenced-transforms-test+(deftest ^:synchronized unreferenced-transforms-test(testing "GET /api/ee/dependencies/unreferenced - only unreferenced transforms are returned"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)@@ -1165,7 +1165,7 @@:data {:name "Unreferenced Transform - unreftest"}}]}response))))))))-(deftest ^:sequential unreferenced-snippets-test+(deftest ^:synchronized unreferenced-snippets-test(testing "GET /api/ee/dependencies/unreferenced - only unreferenced snippets are returned"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)]@@ -1191,7 +1191,7 @@:data {:name "Unreferenced Snippet - unreftest"}}]}response))))))))))-(deftest ^:sequential unreferenced-dashboards-test+(deftest ^:synchronized unreferenced-dashboards-test(testing "GET /api/ee/dependencies/unreferenced - only unreferenced dashboards are returned"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Dashboard {unreffed-dashboard-id :id} {:name "Unreferenced Dashboard - unreftest"}@@ -1211,7 +1211,7 @@:data {:name "Unreferenced Dashboard - unreftest"}}]}response)))))))-(deftest ^:sequential unreferenced-documents-test+(deftest ^:synchronized unreferenced-documents-test(testing "GET /api/ee/dependencies/unreferenced - only unreferenced documents are returned"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Document {referenced-document-id :id} {:name "Referenced Document - unreftest"}@@ -1230,7 +1230,7 @@:data {:name "Unreferenced Document - unreftest"}}]}response)))))))-(deftest ^:sequential unreferenced-sandboxes-test+(deftest ^:synchronized unreferenced-sandboxes-test(testing "GET /api/ee/dependencies/unreferenced - unreferenced sandboxes are returned"(mt/with-premium-features #{:dependencies :sandboxes}(let [mp (mt/metadata-provider)@@ -1249,7 +1249,7 @@:data {:table {:name "PRODUCTS"}}}]}response))))))))-(deftest ^:sequential unreferenced-card-types-test+(deftest ^:synchronized unreferenced-card-types-test(testing "GET /api/ee/dependencies/unreferenced - unreferenced models and metrics are filtered by card-types and pagination"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)@@ -1287,7 +1287,7 @@:type "metric"}}]}response)))))))))-(deftest ^:sequential unreferenced-archived-card-test+(deftest ^:synchronized unreferenced-archived-card-test(testing "GET /api/ee/dependencies/graph/unreferenced with archived parameter"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)@@ -1305,7 +1305,7 @@(is (contains? card-ids unreffed-card-id))(is (not (contains? card-ids archived-card-id)))))))))-(deftest ^:sequential unreferenced-archived-dashboard-test+(deftest ^:synchronized unreferenced-archived-dashboard-test(testing "GET /api/ee/dependencies/graph/unreferenced with archived parameter for dashboards"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Dashboard {unreffed-dashboard-id :id} {:name "Unreferenced Dashboard - archivedtest"}@@ -1317,7 +1317,7 @@(is (contains? dashboard-ids unreffed-dashboard-id))(is (not (contains? dashboard-ids archived-dashboard-id))))))))-(deftest ^:sequential unreferenced-archived-document-test+(deftest ^:synchronized unreferenced-archived-document-test(testing "GET /api/ee/dependencies/graph/unreferenced with archived parameter for documents"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Document {unreffed-document-id :id} {:name "Unreferenced Document - archivedtest"}@@ -1329,7 +1329,7 @@(is (contains? document-ids unreffed-document-id))(is (not (contains? document-ids archived-document-id))))))))-(deftest ^:sequential unreferenced-archived-snippet-test+(deftest ^:synchronized unreferenced-archived-snippet-test(testing "GET /api/ee/dependencies/graph/unreferenced with archived parameter for snippets"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/NativeQuerySnippet {unreffed-snippet-id :id} {:name "Unreferenced Snippet - archivedtest"@@ -1343,7 +1343,7 @@(is (contains? snippet-ids unreffed-snippet-id))(is (not (contains? snippet-ids archived-snippet-id))))))))-(deftest ^:sequential unreferenced-excludes-internal-content-test+(deftest ^:synchronized unreferenced-excludes-internal-content-test(testing "GET /api/ee/dependencies/graph/unreferenced excludes system-managed (internal-user) content"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)@@ -1372,7 +1372,7 @@(is (contains? dashboard-ids regular-dashboard-id))(is (not (contains? dashboard-ids internal-dashboard-id))))))))))-(deftest ^:sequential breaking-entities-includes-internal-content-test+(deftest ^:synchronized breaking-entities-includes-internal-content-test(testing "GET /api/ee/dependencies/graph/breaking still surfaces internal-user (system-managed) content"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1394,7 +1394,7 @@(is (contains? card-ids (:id internal-model))"Internal-user model card should still appear in breaking list"))))))))-(deftest ^:sequential unreferenced-archived-segment-test+(deftest ^:synchronized unreferenced-archived-segment-test(testing "GET /api/ee/dependencies/graph/unreferenced with archived parameter for segments"(mt/with-premium-features #{:dependencies}(let [products-id (mt/id :products)@@ -1414,7 +1414,7 @@(is (contains? segment-ids unreffed-segment-id))(is (not (contains? segment-ids archived-segment-id)))))))))-(deftest ^:sequential unreferenced-archived-table-test+(deftest ^:synchronized unreferenced-archived-table-test(testing "GET /api/ee/dependencies/graph/unreferenced includes inactive and hidden tables"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Table {active-table-id :id} {:name "Active Unreferenced Table - archivedtest"@@ -1436,7 +1436,7 @@(testing "hidden tables are always included"(is (contains? table-ids hidden-table-id))))))))-(deftest ^:sequential unreferenced-pagination-test+(deftest ^:synchronized unreferenced-pagination-test(testing "GET /api/ee/dependencies/unreferenced - should paginate results"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Table {table1-id :id} {:name "Table 1 - unreftest"}@@ -1454,7 +1454,7 @@:limit 2}(mt/user-http-request :crowberto :get 200 "ee/dependencies/graph/unreferenced?types=table&query=unreftest&offset=2&limit=2")))))))-(deftest ^:sequential unreferenced-sample-db-test+(deftest ^:synchronized unreferenced-sample-db-test(testing "GET /api/ee/dependencies/unreferenced - should not return tables from the sample database"(mt/with-premium-features #{:dependencies}(mt/with-empty-h2-app-db!@@ -1464,7 +1464,7 @@:total 0}(mt/user-http-request :crowberto :get 200 "ee/dependencies/graph/unreferenced?types=table&query=unreftest"))))))))-(deftest ^:sequential unreferenced-audit-db-test+(deftest ^:synchronized unreferenced-audit-db-test(testing "GET /api/ee/dependencies/unreferenced - should not return tables from the audit database"(mt/with-premium-features #{:dependencies}(mt/with-empty-h2-app-db!@@ -1473,7 +1473,7 @@:total 0}(mt/user-http-request :crowberto :get 200 "ee/dependencies/graph/unreferenced?types=table&query=notification")))))))-(deftest ^:sequential unreferenced-archived-measure-test+(deftest ^:synchronized unreferenced-archived-measure-test(testing "GET /api/ee/dependencies/graph/unreferenced with archived parameter for measures"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)@@ -1497,7 +1497,7 @@(is (contains? measure-ids unreffed-measure-id))(is (not (contains? measure-ids archived-measure-id)))))))))-(deftest ^:sequential unreferenced-personal-collection-card-test+(deftest ^:synchronized unreferenced-personal-collection-card-test(testing "GET /api/ee/dependencies/graph/unreferenced with include-personal-collections parameter for cards"(mt/with-premium-features #{:dependencies}(binding [collection/*allow-deleting-personal-collections* true]@@ -1533,7 +1533,7 @@(is (contains? card-ids card-in-sub-personal))(is (contains? card-ids card-regular))))))))))-(deftest ^:sequential unreferenced-personal-collection-dashboard-test+(deftest ^:synchronized unreferenced-personal-collection-dashboard-test(testing "GET /api/ee/dependencies/graph/unreferenced with include-personal-collections parameter for dashboards"(mt/with-premium-features #{:dependencies}(binding [collection/*allow-deleting-personal-collections* true]@@ -1555,7 +1555,7 @@(is (contains? dashboard-ids dash-in-personal))(is (contains? dashboard-ids dash-regular)))))))))-(deftest ^:sequential unreferenced-sort-by-name-test+(deftest ^:synchronized unreferenced-sort-by-name-test(testing "GET /api/ee/dependencies/graph/unreferenced - sorting by name"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Card _ {:name "A Card sorttest"}@@ -1586,7 +1586,7 @@(= sort-direction :desc) reverse)names))))))))-(deftest ^:sequential unreferenced-sort-by-location-test+(deftest ^:synchronized unreferenced-sort-by-location-test(testing "GET /api/ee/dependencies/graph/unreferenced - sorting by location"(mt/with-premium-features #{:dependencies}(mt/with-temp [;; locations@@ -1653,7 +1653,7 @@(= sort-direction :desc) reverse)names))))))))-(deftest ^:sequential unreferenced-sort-by-location-with-root-collection-test+(deftest ^:synchronized unreferenced-sort-by-location-with-root-collection-test(testing "GET /api/ee/dependencies/graph/unreferenced - sorting by location with root collection"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Collection {collection1-id :id} {:name "Collection 1"}@@ -1677,7 +1677,7 @@(= sort-direction :desc) reverse)names))))))))-(deftest ^:sequential breaking-entities-returns-source-of-errors-test+(deftest ^:synchronized breaking-entities-returns-source-of-errors-test(testing "GET /api/ee/dependencies/graph/breaking - returns entities that are SOURCE of downstream errors"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1698,7 +1698,7 @@(is (= [(:id model-card)] (mapv :id (:data response)))"Model card should appear as a breaking entity"))))))))-(deftest ^:sequential breaking-entities-types-filtering-test+(deftest ^:synchronized breaking-entities-types-filtering-test(testing "GET /api/ee/dependencies/graph/breaking - types parameter filters results"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1730,7 +1730,7 @@ids (set (map :id (:data response)))](is (empty? ids) "No tables should be in results")))))))))-(deftest ^:sequential breaking-entities-archived-card-test+(deftest ^:synchronized breaking-entities-archived-card-test(testing "GET /api/ee/dependencies/graph/breaking includes archived source cards that break a non-archived dependent"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1762,7 +1762,7 @@;; (dependent-card-2) has an error traced back to it, so it should be surfaced.(is (contains? card-ids (:id archived-model))))))))))-(deftest ^:sequential breaking-entities-inactive-table-test+(deftest ^:synchronized breaking-entities-inactive-table-test(testing "GET /api/ee/dependencies/graph/breaking?types=table includes an inactive table that breaks a non-archived dependent"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/Database db {:engine :h2, :name "inactive-table-breaking-test"}@@ -1796,7 +1796,7 @@table-ids (set (map :id (:data response)))](is (contains? table-ids (:id table))))))))))))-(deftest ^:sequential breaking-entities-multiple-dependents-test+(deftest ^:synchronized breaking-entities-multiple-dependents-test(testing "GET /api/ee/dependencies/graph/breaking - model breaking multiple dependents appears once"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1820,7 +1820,7 @@model-ids (filter #(= (:id %) (:id model-card)) (:data response))](is (= 1 (count model-ids)) "Model should appear exactly once even with multiple broken dependents"))))))))-(deftest ^:sequential breaking-entities-personal-collection-card-test+(deftest ^:synchronized breaking-entities-personal-collection-card-test(testing "GET /api/ee/dependencies/graph/breaking with include-personal-collections parameter"(mt/with-premium-features #{:dependencies}(binding [collection/*allow-deleting-personal-collections* true]@@ -1858,7 +1858,7 @@(is (contains? card-ids (:id model-in-personal)))(is (contains? card-ids (:id model-regular))))))))))))-(deftest ^:sequential breaking-entities-pagination-test+(deftest ^:synchronized breaking-entities-pagination-test(testing "GET /api/ee/dependencies/graph/breaking - should paginate results"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1891,7 +1891,7 @@:limit 1}(mt/user-http-request :crowberto :get 200 "ee/dependencies/graph/breaking?types=card&query=paginationtest&offset=1&limit=1")))))))))-(deftest ^:sequential breaking-entities-sort-by-name-test+(deftest ^:synchronized breaking-entities-sort-by-name-test(testing "GET /api/ee/dependencies/graph/breaking - sorting by name"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -1926,7 +1926,7 @@(= sort-direction :desc) reverse)names))))))))))-(deftest ^:sequential breaking-entities-sort-by-location-test+(deftest ^:synchronized breaking-entities-sort-by-location-test(testing "GET /api/ee/dependencies/graph/breaking - sorting by location"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}@@ -1963,7 +1963,7 @@(= sort-direction :desc) reverse)names))))))))))-(deftest ^:sequential breaking-entities-sort-by-dependents-with-errors-count-test+(deftest ^:synchronized breaking-entities-sort-by-dependents-with-errors-count-test(testing "GET /api/ee/dependencies/graph/breaking - sorting by dependents with errors count"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -2001,7 +2001,7 @@(= sort-direction :desc) reverse)names))))))))))-(deftest ^:sequential breaking-entities-sort-by-dependents-with-errors-test+(deftest ^:synchronized breaking-entities-sort-by-dependents-with-errors-test(testing "GET /api/ee/dependencies/graph/breaking - sorting by dependents with errors count"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -2062,7 +2062,7 @@~base-card-binding (card/create-card! (basic-card "Base") user#)]~@body)))))-(deftest ^:sequential dependents-query-filter-test+(deftest ^:synchronized dependents-query-filter-test(testing "GET /api/ee/dependencies/graph/dependents with query parameter"(with-dependents-test! [user {base-card-id :id :as base-card}](create-dependent! base-card user "Alpha")@@ -2078,7 +2078,7 @@(testing "no query returns all dependents"(is (= 3 (count (get-dependents base-card-id))))))))-(deftest ^:sequential dependents-query-filter-by-location-test+(deftest ^:synchronized dependents-query-filter-by-location-test(testing "GET /api/ee/dependencies/graph/dependents query filters by location (collection name)"(with-dependents-test! [user {base-card-id :id :as base-card}](mt/with-temp [:model/Collection {coll-id :id} {:name "SpecialCollection"}]@@ -2088,7 +2088,7 @@(is (=? [{:data {:name "Card in collection"}}](get-dependents base-card-id :query "SpecialCollection")))))))-(deftest ^:sequential dependents-personal-collections-test+(deftest ^:synchronized dependents-personal-collections-test(testing "GET /api/ee/dependencies/graph/dependents with include-personal-collections parameter"(binding [collection/*allow-deleting-personal-collections* true](with-dependents-test! [{user-id :id :as user} {base-card-id :id :as base-card}]@@ -2104,7 +2104,7 @@(testing "include-personal-collections=true includes them"(is (= 3 (count (get-dependents base-card-id :include-personal-collections true))))))))))-(deftest ^:sequential dependents-sort-by-name-test+(deftest ^:synchronized dependents-sort-by-name-test(testing "GET /api/ee/dependencies/graph/dependents - sorting by name"(with-dependents-test! [user {base-card-id :id :as base-card}](create-dependent! base-card user "C Card")@@ -2116,7 +2116,7 @@(is (=? [{:data {:name "C Card"}} {:data {:name "B Card"}} {:data {:name "A Card"}}](get-dependents base-card-id :sort-column :name :sort-direction :desc))))))-(deftest ^:sequential dependents-sort-by-location-test+(deftest ^:synchronized dependents-sort-by-location-test(testing "GET /api/ee/dependencies/graph/dependents - sorting by location"(with-dependents-test! [user {base-card-id :id :as base-card}](mt/with-temp [:model/Collection {coll-a :id} {:name "A Collection"}@@ -2131,7 +2131,7 @@(is (=? [{:data {:name "In C"}} {:data {:name "In B"}} {:data {:name "In A"}}](get-dependents base-card-id :sort-column :location :sort-direction :desc)))))))-(deftest ^:sequential dependents-sort-by-view-count-test+(deftest ^:synchronized dependents-sort-by-view-count-test(testing "GET /api/ee/dependencies/graph/dependents - sorting by view-count"(with-dependents-test! [user {base-card-id :id :as base-card}](let [{low-id :id} (create-dependent! base-card user "Low")@@ -2146,7 +2146,7 @@(is (=? [{:data {:view_count 100}} {:data {:view_count 50}} {:data {:view_count 10}}](get-dependents base-card-id :sort-column :view-count :sort-direction :desc)))))))-(deftest ^:sequential dependents-sort-view-count-mixed-types-test+(deftest ^:synchronized dependents-sort-view-count-mixed-types-test(testing "GET /api/ee/dependencies/graph/dependents - view-count sorting with mixed entity types"(with-dependents-test! [user {base-card-id :id :as base-card}](mt/with-model-cleanup [:model/DashboardCard]@@ -2164,7 +2164,7 @@(is (=? [{:data {:view_count 200}} {:data {:view_count 100}} {:data {:view_count 10}}](get-dependents base-card-id :sort-column :view-count :sort-direction :desc)))))))))-(deftest ^:sequential dependents-query-and-sort-combined-test+(deftest ^:synchronized dependents-query-and-sort-combined-test(testing "GET /api/ee/dependencies/graph/dependents with query and sort together"(with-dependents-test! [user {base-card-id :id :as base-card}](create-dependent! base-card user "C Match")@@ -2175,7 +2175,7 @@(is (=? [{:data {:name "A Match"}} {:data {:name "B Match"}} {:data {:name "C Match"}}](get-dependents base-card-id :query "Match" :sort-column :name :sort-direction :asc))))))-(deftest ^:sequential node-errors-filtering-test+(deftest ^:synchronized node-errors-filtering-test(testing "node-errors filters by source visibility"(mt/with-current-user (mt/user->id :rasta)(mt/with-temp [:model/Collection {coll-id :id} {}@@ -2210,7 +2210,7 @@(testing "includes errors with nil source"(is (contains? card-errors {:type :invalid-query}))))))))-(deftest ^:sequential node-downstream-errors-filtering-test+(deftest ^:synchronized node-downstream-errors-filtering-test(testing "node-downstream-errors filters by analyzed entity visibility"(mt/with-current-user (mt/user->id :rasta)(mt/with-temp [:model/Collection {coll-id :id} {}@@ -2236,7 +2236,7 @@(testing "the included error is the visible one"(is (= visible-card (:analyzed_entity_id (first card-errors))))))))))-(deftest ^:sequential broken-endpoint-error-visibility-filtering-test+(deftest ^:synchronized broken-endpoint-error-visibility-filtering-test(testing "GET /api/ee/dependencies/graph/breaking - pagination and sorting work with error visibility filtering"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -2332,7 +2332,7 @@(testing "descending order puts more errors first"(is (= (:id model-card-b) (-> desc-response :data first :id))))))))))))-(deftest ^:sequential broken-endpoint-sort-by-visible-errors-only-test+(deftest ^:synchronized broken-endpoint-sort-by-visible-errors-only-test(testing "GET /api/ee/dependencies/graph/breaking - sorting counts only visible errors, not archived"(mt/with-premium-features #{:dependencies}(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -2398,7 +2398,7 @@;; so B comes first. With fix, sort counts visible errors (A=1, B=2) so A comes first.(is (= (:id model-card-a) (-> asc-response :data first :id)))))))))))-(deftest ^:sequential unreferenced-pagination-with-archived-items-test+(deftest ^:synchronized unreferenced-pagination-with-archived-items-test(testing "GET /api/ee/dependencies/graph/unreferenced - pagination works correctly with archived items"(mt/with-premium-features #{:dependencies}(mt/with-model-cleanup [:model/Dependency :model/DependencyStatus]@@ -2420,7 +2420,7 @@:limit 2}response))))))))-(deftest ^:sequential unreferenced-pagination-with-archived-dependents-test+(deftest ^:synchronized unreferenced-pagination-with-archived-dependents-test(testing "GET /api/ee/dependencies/graph/unreferenced - should return items if all dependents are archived"(mt/with-premium-features #{:dependencies}(mt/with-model-cleanup [:model/Dependency :model/DependencyStatus]@@ -2697,7 +2697,7 @@(is (contains? card-ids (:id dependent-in-personal)))(is (contains? card-ids (:id dependent-regular))))))))))))-(deftest ^:sequential unreferenced-table-owner-test+(deftest ^:synchronized unreferenced-table-owner-test(testing "GET /api/ee/dependencies/unreferenced - table owner is returned"(mt/with-premium-features #{:dependencies}(mt/with-model-cleanup [:model/Dependency :model/DependencyStatus]@@ -2721,7 +2721,7 @@:email "[email protected]"}}}]}response))))))))-(deftest ^:sequential unreferenced-transform-owner-test+(deftest ^:synchronized unreferenced-transform-owner-test(testing "GET /api/ee/dependencies/unreferenced - transform owner is returned"(mt/with-premium-features #{:dependencies}(let [mp (mt/metadata-provider)diff --git a/enterprise/backend/test/metabase_enterprise/dependencies/events_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/events_test.cljindex c75963fc5de..c8a18c2af62 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/events_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/events_test.clj@@ -305,7 +305,7 @@(is (not (t2/exists? :model/DependencyStatus :entity_type :card :entity_id card-id :stale true))"Entity should not be marked stale when mark-stale! fails")))))))-(deftest ^:sequential native-transform-updates-dependencies-test+(deftest ^:synchronized native-transform-updates-dependencies-test(testing "native transform update events trigger dependency calculations"(run-with-dependencies-setup!(fn [mp]@@ -321,7 +321,7 @@:to_entity_id (mt/id :orders)}](t2/select :model/Dependency :from_entity_id transform-id :from_entity_type :transform)))))))))-(deftest ^:sequential mbql-transform-updates-dependencies-test+(deftest ^:synchronized mbql-transform-updates-dependencies-test(testing "mbql transform update events trigger dependency calculations"(run-with-dependencies-setup!(fn [mp]@@ -337,7 +337,7 @@:to_entity_id (mt/id :orders)}](t2/select :model/Dependency :from_entity_id transform-id :from_entity_type :transform)))))))))-(deftest ^:sequential python-transform-updates-dependencies-test+(deftest ^:synchronized python-transform-updates-dependencies-test(testing "python transform update events trigger dependency calculations"(run-with-dependencies-setup!(fn [_]@@ -360,7 +360,7 @@:to_entity_id (mt/id :orders)}](t2/select :model/Dependency :from_entity_id transform-id :from_entity_type :transform)))))))))-(deftest ^:sequential database-delete-marks-source-transforms-stale-test+(deftest ^:synchronized database-delete-marks-source-transforms-stale-test(testing "deleting a database marks its source transforms' analysis findings stale so they surface on /dependency-diagnostics/broken (GDGT-2447)"(run-with-dependencies-setup!(fn [_mp]@@ -403,7 +403,7 @@:analyzed_entity_type :transform:analyzed_entity_id transform-id))))))))))-(deftest ^:sequential transform-run-updates-dependencies-test+(deftest ^:synchronized transform-run-updates-dependencies-test(testing "transform run events trigger dependency calculations"(run-with-dependencies-setup!(fn [_]@@ -422,7 +422,7 @@:to_entity_id transform-id}](t2/select :model/Dependency :to_entity_id transform-id :to_entity_type :transform)))))))))-(deftest ^:sequential python-transform-update-handles-downstream-dependencies-test+(deftest ^:synchronized python-transform-update-handles-downstream-dependencies-test(testing "python transform update events handles downstream dependencies"(run-with-dependencies-setup!(fn [_]@@ -472,7 +472,7 @@(is (empty?(t2/select :model/Dependency :to_entity_id transform-id :to_entity_type :transform)))))))))))-(deftest ^:sequential query-transform-update-handles-downstream-dependencies-test+(deftest ^:synchronized query-transform-update-handles-downstream-dependencies-test(testing "query transform update events handles downstream dependencies"(run-with-dependencies-setup!(fn [mp]@@ -693,7 +693,7 @@(is (contains? analyses-map id))(is (= expected-version (analyses-map id)))))))))-(deftest ^:sequential card-update-works-with-no-analyses-test+(deftest ^:synchronized card-update-works-with-no-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Card updates should mark the card stale and trigger the background job"@@ -714,7 +714,7 @@:analyzed_entity_id child-card-id))"entities without analysis findings should not be marked: no fake analysis record should be created")))))))-(deftest ^:sequential card-update-updates-analyses-test+(deftest ^:synchronized card-update-updates-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Card updates should mark the card stale, then the job re-analyzes and propagates"@@ -753,7 +753,7 @@;;; ------------------------------------------------ Analysis propagation tests -------------------------------------------------(deftest ^:sequential card-update-triggers-native-cards-test+(deftest ^:synchronized card-update-triggers-native-cards-test(run-with-dependencies-setup!(fn [mp](testing "Card update marks the card and its transitive dependents stale, and the entity-check job re-analyzes them"@@ -780,7 +780,7 @@:analyzed_entity_type :card:analyzed_entity_id child-id)))))))))-(deftest ^:sequential card-update-stops-on-transforms-test+(deftest ^:synchronized card-update-stops-on-transforms-test(run-with-dependencies-setup!(fn [mp](testing "Card update marks the card and its transitive dependents (including transforms) stale up front"@@ -817,7 +817,7 @@(is (false? (t2/select-one-fn :stale :model/AnalysisFinding:analyzed_entity_type :card :analyzed_entity_id child-card-id))))))))))-(deftest ^:sequential transform-update-works-with-no-analyses-test+(deftest ^:synchronized transform-update-works-with-no-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Transform update does not error when no analyses exist yet"@@ -831,7 +831,7 @@;; Should not throw even when no analysis findings exist(is (some? (events/publish-event! :event/update-transform {:object transform :user-id api/*current-user-id*})))))))))-(deftest ^:sequential transform-update-updates-analyses-test+(deftest ^:synchronized transform-update-updates-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Transform update marks entity stale, entity-check job re-analyzes it"@@ -856,7 +856,7 @@:analyzed_entity_type :transform:analyzed_entity_id transform-id))))))))))-(deftest ^:sequential transform-update-triggers-native-transforms-test+(deftest ^:synchronized transform-update-triggers-native-transforms-test(run-with-dependencies-setup!(fn [mp](testing "Native transform updates do not error"@@ -869,7 +869,7 @@;; Should not throw even for native transforms(is (some? (events/publish-event! :event/update-transform {:object transform :user-id api/*current-user-id*}))))))))-(deftest ^:sequential transform-run-works-with-no-analyses-test+(deftest ^:synchronized transform-run-works-with-no-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Transform run completes without error when no analyses exist"@@ -887,7 +887,7 @@:transform-id transform-id}:user-id api/*current-user-id*})))))))))-(deftest ^:sequential transform-run-marks-dependents-stale-test+(deftest ^:synchronized transform-run-marks-dependents-stale-test(run-with-dependencies-setup!(fn [mp](testing "Transform run marks immediate dependents stale"@@ -919,7 +919,7 @@(is (false? (t2/select-one-fn :stale :model/AnalysisFinding:analyzed_entity_type :transform :analyzed_entity_id transform-id))))))))))-(deftest ^:sequential segment-update-works-with-no-analyses-test+(deftest ^:synchronized segment-update-works-with-no-analyses-test(run-with-dependencies-setup!(fn [_](testing "Segment update does not error when no analyses exist yet"@@ -930,7 +930,7 @@;; Should not throw even when no analysis findings exist(is (some? (events/publish-event! :event/segment-update {:object segment :user-id api/*current-user-id*})))))))))-(deftest ^:sequential segment-update-updates-analyses-test+(deftest ^:synchronized segment-update-updates-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Segment update marks entity stale, entity-check job re-analyzes and propagates"@@ -957,7 +957,7 @@(is (false? (t2/select-one-fn :stale :model/AnalysisFinding:analyzed_entity_type :card :analyzed_entity_id card-id))))))))))-(deftest ^:sequential table-metadata-update-triggers-dependent-analysis-test+(deftest ^:synchronized table-metadata-update-triggers-dependent-analysis-test(run-with-dependencies-setup!(fn [mp](testing "Table metadata update marks immediate dependents stale"@@ -981,7 +981,7 @@(is (false? (t2/select-one-fn :stale :model/AnalysisFinding:analyzed_entity_type :card :analyzed_entity_id other-card-id)))))))))))-(deftest ^:sequential table-metadata-update-works-with-no-analyses-test+(deftest ^:synchronized table-metadata-update-works-with-no-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Table metadata update does not error when no findings exist yet"@@ -994,7 +994,7 @@(events/publish-event! :event/table-update {:object table :user-id api/*current-user-id*})(assert-has-analyses {:card {card-id nil}}))))))))-(deftest ^:sequential field-metadata-update-triggers-dependent-analysis-test+(deftest ^:synchronized field-metadata-update-triggers-dependent-analysis-test(run-with-dependencies-setup!(fn [mp](testing "Field metadata update marks dependents of the field's table stale"@@ -1018,7 +1018,7 @@(is (false? (t2/select-one-fn :stale :model/AnalysisFinding:analyzed_entity_type :card :analyzed_entity_id other-card-id)))))))))))-(deftest ^:sequential field-metadata-update-works-with-no-analyses-test+(deftest ^:synchronized field-metadata-update-works-with-no-analyses-test(run-with-dependencies-setup!(fn [mp](testing "Field metadata update does not error when no findings exist yet"diff --git a/enterprise/backend/test/metabase_enterprise/dependencies/findings_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/findings_test.cljindex b04afc82e61..52a4ed7ec1d 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/findings_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/findings_test.clj@@ -22,7 +22,7 @@(doseq [model [:card :transform :segment]](while (pos? (deps.findings/analyze-batch! model 100)))))-(deftest ^:sequential can-analyze-entity-batches-test+(deftest ^:synchronized can-analyze-entity-batches-test(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)products-id (mt/id :products)@@ -39,7 +39,7 @@:analyzed_entity_id [:in [card-id other-card-id]]:analyzed_entity_type :card)))))))-(deftest ^:sequential does-not-repeatedly-analyze-entities-test+(deftest ^:synchronized does-not-repeatedly-analyze-entities-test(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)products-id (mt/id :products)@@ -52,7 +52,7 @@(is (= 2 (deps.findings/analyze-batch! :card 2)))(is (= 0 (deps.findings/analyze-batch! :card 2)))))))-(deftest ^:sequential re-analyze-entities-when-analysis-version-bumped-test+(deftest ^:synchronized re-analyze-entities-when-analysis-version-bumped-test(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)products (lib.metadata/table mp (mt/id :products))@@ -65,7 +65,7 @@(binding [models.analysis-finding/*current-analysis-finding-version* (inc models.analysis-finding/*current-analysis-finding-version*)](is (= 2 (deps.findings/analyze-batch! :card 2))))))))-(deftest ^:sequential does-analyze-native-entities-test+(deftest ^:synchronized does-analyze-native-entities-test(testing "failed analysis result is appropriately stored in the appdb"(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)]@@ -78,7 +78,7 @@:analyzed_entity_id card-id:analyzed_entity_type :card))))))))-(deftest ^:sequential does-report-errors-for-missing-refs-in-fields-test+(deftest ^:synchronized does-report-errors-for-missing-refs-in-fields-test(testing "missing (not inactive) field refs in :fields are reported as findings (GHY-3157)"(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)@@ -137,7 +137,7 @@:analyzed_entity_type entity-type:analyzed_entity_id entity-id))-(deftest ^:sequential analyze-batch-picks-up-missing-analyses-test+(deftest ^:synchronized analyze-batch-picks-up-missing-analyses-test(testing "analyze-batch! picks up entities with no pre-existing AnalysisFinding"(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)@@ -207,7 +207,7 @@(stale-map [grandparent-id parent-id child-id]))"grandparent should NOT be stale, parent and child should be stale (transitive)")))))))))-(deftest ^:sequential mark-subtree-stale-then-drain-test+(deftest ^:synchronized mark-subtree-stale-then-drain-test(testing "marking an entity stale also marks its whole transitive subtree up front, and check-entities! drains it"(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)@@ -238,7 +238,7 @@(stale-map [gp-id p-id c-id]))"after check-entities!, the whole subtree should be re-analyzed (not stale)"))))))))-(deftest ^:sequential transitive-marking-through-non-analyzable-entity-test+(deftest ^:synchronized transitive-marking-through-non-analyzable-entity-test(testing "marking dependents stale reaches analyzable entities beyond non-analyzable intermediaries (e.g., tables)"(backfill-all-entity-analyses!)(let [mp (mt/metadata-provider)@@ -275,7 +275,7 @@(is (false? (finding-stale? :card card-id))"card should be re-analyzed after entity-check"))))))))-(deftest ^:sequential cyclic-dependency-drain-terminates-test+(deftest ^:synchronized cyclic-dependency-drain-terminates-test(testing "check-entities! terminates on a cyclic dependency graph — staleness is fixed up front and never re-markedduring the drain"(backfill-all-entity-analyses!)@@ -304,7 +304,7 @@(stale-map [a-id b-id]))"both cycle members should be drained (re-analyzed, not stale)")))))))))-(deftest ^:sequential unanalyzable-entity-records-terminal-error-test+(deftest ^:synchronized unanalyzable-entity-records-terminal-error-test(testing "A stale entity whose database can't be resolved records a terminal error finding instead of no-oping forever.";; Without the fix, instance-db-id -> nil makes upsert-analysis! no-op: the stale flag is never;; cleared, so the entity is re-selected and re-attempted on every run. The fix records a terminal@@ -327,7 +327,7 @@(is (seq (models.analysis-finding-error/errors-for-entity :card cid))"an error finding is recorded explaining why the entity couldn't be analyzed")))))))-(deftest ^:sequential unanalyzable-entity-rechecks-when-database-resolvable-again-test+(deftest ^:synchronized unanalyzable-entity-rechecks-when-database-resolvable-again-test(testing "After a no-DB terminal error, the entity is analyzed normally once its database resolves again.";; The terminal error finding is not sticky: it clears the stale flag but does not block future;; analysis. When the entity is next marked stale and its database now resolves, upsert-analysis!@@ -358,7 +358,7 @@:analyzed_entity_type :card :analyzed_entity_id cid))"phase 2: re-analysis cleared stale again"))))))))-(deftest ^:sequential analyze-batch-shares-one-metadata-provider-test+(deftest ^:synchronized analyze-batch-shares-one-metadata-provider-test(testing "Every entity in an analysis batch must share one MetadataProvider per database. Reading an entity attachesa provider to its query, so selecting the batch outside the cache gives each entity a private one. Nothingreads through those providers today -- upsert-analysis! builds its own from the database id and passes itdiff --git a/enterprise/backend/test/metabase_enterprise/dependencies/metadata_update_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/metadata_update_test.cljindex e310dbd4b1e..616878c654d 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/metadata_update_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/metadata_update_test.clj@@ -108,7 +108,7 @@:grandchild-data {}:should-traverse? true})))-(deftest ^:sequential card-update-updates-child-metadata-test+(deftest ^:synchronized card-update-updates-child-metadata-test(testing "card updates update child card metadata"(mt/with-test-user :rasta(mt/with-premium-features #{:dependencies}@@ -143,7 +143,7 @@[:model/Card :id :result_metadata :card_schema]:id [:in [parent-id child-id grandchild-id]])))))))))-(deftest ^:sequential native-card-update-does-not-update-children-test+(deftest ^:synchronized native-card-update-does-not-update-children-test(testing "native card updates do not update children"(mt/with-test-user :rasta(mt/with-premium-features #{:dependencies}@@ -168,7 +168,7 @@[:model/Card :id :result_metadata :card_schema]:id child-id)))))))))-(deftest ^:sequential model-update-passes-down-new-values-test+(deftest ^:synchronized model-update-passes-down-new-values-test(testing "model updates pass down new result metadata"(mt/with-test-user :rasta(mt/with-premium-features #{:dependencies}@@ -204,7 +204,7 @@[:model/Card :id :result_metadata :card_schema]:id [:in [child-id grandchild-id]]))))))))))-(deftest ^:sequential model-update-respects-child-overrides-test+(deftest ^:synchronized model-update-respects-child-overrides-test(testing "model updates respect child metadata edits"(mt/with-test-user :rasta(mt/with-premium-features #{:dependencies}@@ -247,7 +247,7 @@[:model/Card :id :result_metadata :card_schema]:id [:in [child-id grandchild-id]]))))))))))-(deftest ^:sequential model-update-stops-recursing-when-child-metadata-is-unchanged-test+(deftest ^:synchronized model-update-stops-recursing-when-child-metadata-is-unchanged-test(testing "model updates stop recursing when they hit a child whose metadata didn't change"(mt/with-test-user :rasta(mt/with-premium-features #{:dependencies}@@ -345,7 +345,7 @@:filter-field-id filter-field-id}))))));; Integration test that a real DB sync triggers re-analysis of an updated table.-(deftest ^:sequential sync-removed-column-triggers-reanalysis-test+(deftest ^:synchronized sync-removed-column-triggers-reanalysis-test(testing "When sync detects a removed column, re-analyzing the card shows errors"(with-syncable-db!(fn [{:keys [card-id filter-field-id]}]@@ -383,7 +383,7 @@;; Integration test that a DB sync which doesn't change anything about a table does not trigger re-analysis of all;; cards which depend on that table.-(deftest ^:sequential sync-without-changes-does-not-trigger-reanalysis-test+(deftest ^:synchronized sync-without-changes-does-not-trigger-reanalysis-test(testing "When sync makes no changes to a table or its fields, the card is not re-analyzed"(with-syncable-db!(fn [{:keys [card-id db-id filter-field-id table-id]}]diff --git a/enterprise/backend/test/metabase_enterprise/dependencies/models/analysis_finding_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/models/analysis_finding_test.cljindex be590bc459f..e223a03d437 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/models/analysis_finding_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/models/analysis_finding_test.clj@@ -43,7 +43,7 @@:analyzed_entity_type :card:analyzed_entity_id card-id))))))))-(deftest ^:sequential instances-for-analysis-serves-oldest-analyzed-first-test+(deftest ^:synchronized instances-for-analysis-serves-oldest-analyzed-first-test(testing "Among stale entities, instances-for-analysis returns the oldest-analyzed first.";; Fairness tiebreak: the primary sort only ranks stale-before-outdated, so among equally-stale;; rows the order was DB-arbitrary. A batch smaller than the stale backlog could then keepdiff --git a/enterprise/backend/test/metabase_enterprise/dependencies/models/dependency_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/models/dependency_test.cljindex fce3501880a..a4e116cdd1d 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/models/dependency_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/models/dependency_test.clj@@ -45,7 +45,7 @@{:source-table (str "card__" (:id inner-card))}):visualization_settings {}})-(deftest ^:sequential card-deps-maintenance-test-1-new-card+(deftest ^:synchronized card-deps-maintenance-test-1-new-card(testing "upstream deps of a card are updated correctly"(mt/dataset test-data(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -85,7 +85,7 @@(is (=? #{(depends-on-> :card (:id card1) :table (mt/id :products))}(upstream-of :card (:id card1)))))))))))))-(deftest ^:sequential card-deps-graph-test-1-mbql-card-chain+(deftest ^:synchronized card-deps-graph-test-1-mbql-card-chain(testing "deps graph is connected properly for a chain of MBQL cards"(mt/dataset test-data(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -123,7 +123,7 @@lib/->legacy-MBQL):visualization_settings {}})-(deftest ^:sequential card-deps-graph-test-2-native-card-chain+(deftest ^:synchronized card-deps-graph-test-2-native-card-chain(testing "deps graph is connected properly for a chain of native cards"(mt/dataset test-data(mt/with-temp [:model/User user {:email "[email protected]"}]@@ -154,7 +154,7 @@deps.graph/transitive-dependents:card))))))))))))-(deftest ^:sequential card-deps-graph-metric-test+(deftest ^:synchronized card-deps-graph-metric-test(testing "deps graph is connected properly for a question using a metric"(mt/dataset test-data(mt/with-temp [:model/User user {:email "[email protected]"}]diff --git a/enterprise/backend/test/metabase_enterprise/dependencies/native_validation_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/native_validation_test.cljindex d7e5415cc0d..715a24cc956 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/native_validation_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/native_validation_test.clj@@ -613,7 +613,7 @@:table-id 1}}))](is (empty? (deps.native-validation/validate-native-query driver query))))))-(deftest ^:sequential validate-native-query-with-database-routing-test+(deftest ^:synchronized validate-native-query-with-database-routing-test(testing "native query validation works on databases with routing enabled (#74084)"(mt/with-premium-features #{:database-routing}(let [mp (mt/metadata-provider)diff --git a/enterprise/backend/test/metabase_enterprise/dependencies/task/backfill_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/task/backfill_test.cljindex 46be1cf7ff7..f39e7195b79 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/task/backfill_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/task/backfill_test.clj@@ -46,7 +46,7 @@:dependency_analysis_version dependencies.model/current-dependency-analysis-version)(str "Expected " (name entity-type) " " entity-id " to be processed")))-(deftest ^:sequential backfill-dependency-analysis-test+(deftest ^:synchronized backfill-dependency-analysis-test(testing "Test that the backfill job correctly processes stale entities"(backfill-all-existing-entities!)(with-redefs [env/env (assoc env/env :mb-dependency-backfill-batch-size "2")]@@ -75,7 +75,7 @@(is (false? (backfill-dependencies-single-trigger!)))(is (= 0 (stale-count))))))))))-(deftest ^:sequential backfill-transform-test+(deftest ^:synchronized backfill-transform-test(testing "Test that transforms are correctly backfilled"(backfill-all-existing-entities!)(with-redefs [env/env (assoc env/env :mb-dependency-backfill-batch-size "2")]@@ -101,7 +101,7 @@:from_entity_type :transform :from_entity_id transform-id:to_entity_type :card :to_entity_id card-id)))))))-(deftest ^:sequential backfill-snippet-test+(deftest ^:synchronized backfill-snippet-test(testing "Test that cards with snippets are correctly backfilled"(backfill-all-existing-entities!)(with-redefs [env/env (assoc env/env :mb-dependency-backfill-batch-size "2")]@@ -132,7 +132,7 @@:from_entity_type :card :from_entity_id card-id:to_entity_type :snippet :to_entity_id snippet-id)))))))-(deftest ^:sequential backfill-snippet-in-snippet-test+(deftest ^:synchronized backfill-snippet-in-snippet-test(testing "A snippet referencing another snippet produces a snippet->snippet dependency"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -150,7 +150,7 @@:from_entity_type :snippet :from_entity_id outer-id:to_entity_type :snippet :to_entity_id inner-id))))))-(deftest ^:sequential backfill-snippet-referencing-card-test+(deftest ^:synchronized backfill-snippet-referencing-card-test(testing "A snippet referencing a card produces a snippet->card dependency"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -168,7 +168,7 @@:from_entity_type :snippet :from_entity_id snippet-id:to_entity_type :card :to_entity_id card-id))))))-(deftest ^:sequential backfill-idempotency-test+(deftest ^:synchronized backfill-idempotency-test(testing "Running the backfill multiple times should be idempotent"(backfill-all-existing-entities!)(with-redefs [env/env (assoc env/env :mb-dependency-backfill-batch-size "1")]@@ -195,7 +195,7 @@(when (< (System/currentTimeMillis) limit)(recur))))))-(deftest ^:sequential backfill-scheduling-test+(deftest ^:synchronized backfill-scheduling-test(testing "With 2 entities and batch size 1, the job reschedules itself and processes both"(backfill-all-existing-entities!)(mt/with-temp-scheduler!@@ -222,7 +222,7 @@(wait-for-condition processed? 2500)(is (processed?))))))))))))-(deftest ^:sequential backfill-no-trigger-pile-up-test+(deftest ^:synchronized backfill-no-trigger-pile-up-test(testing "Scheduling new runs while the backfill job is executing keeps the trigger count ≤ 1"(let [job-started (promise)can-finish (promise)]@@ -251,7 +251,7 @@(is (<= (trigger-count) 1)(str "After self-reschedule: expected ≤ 1 trigger, got " (trigger-count)))))))))-(deftest ^:sequential backfill-error-logging-test+(deftest ^:synchronized backfill-error-logging-test(testing "When calculate-deps throws, the error is logged and the entity remains stale"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -271,7 +271,7 @@(is (= 1 (t2/select-one-fn :fail_count :model/DependencyStatus:entity_type :card :entity_id card-id)))))))-(deftest ^:sequential backfill-partial-batch-failure-test+(deftest ^:synchronized backfill-partial-batch-failure-test(testing "A failure on one entity doesn't prevent other entities from being processed"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -297,7 +297,7 @@(is (= 1 (t2/select-one-fn :fail_count :model/DependencyStatus:entity_type :card :entity_id bad-card-id)))))))-(deftest ^:sequential backfill-terminal-failure-test+(deftest ^:synchronized backfill-terminal-failure-test(testing "Entities should be marked as terminally broken after MAX_RETRIES failures"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -323,7 +323,7 @@(backfill-dependencies-single-trigger!)(is (t2/exists? :model/DependencyStatus :entity_type :card :entity_id card-id :stale true))))))-(deftest ^:sequential backfill-delayed-retry-test+(deftest ^:synchronized backfill-delayed-retry-test(testing "Failed entities should be retried after their delay period expires"(backfill-all-existing-entities!)(let [compute-attempts (volatile! 0)]@@ -371,7 +371,7 @@(assert-processed :card card-id)(is (= 1 deps-after))))))))-(deftest ^:sequential backfill-dependencies-on-serdes-load-test+(deftest ^:synchronized backfill-dependencies-on-serdes-load-test(testing "Serdes load triggers the backfill job (entities remain stale until job runs)"(backfill-all-existing-entities!)(let [query (mt/mbql-query orders)]@@ -398,7 +398,7 @@:stale false:dependency_analysis_version dependencies.model/current-dependency-analysis-version))))))))-(deftest ^:sequential backfill-dependencies-on-token-update-test+(deftest ^:synchronized backfill-dependencies-on-token-update-test(testing "Token update triggers the backfill job (entities remain stale until job runs)"(backfill-all-existing-entities!)(let [query (mt/mbql-query orders)]@@ -425,7 +425,7 @@:stale false:dependency_analysis_version dependencies.model/current-dependency-analysis-version))))))))-(deftest ^:sequential backfill-version-outdated-test+(deftest ^:synchronized backfill-version-outdated-test(testing "Entities with outdated version in dependency_status get reprocessed"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -440,7 +440,7 @@(is (t2/exists? :model/Dependency :from_entity_type :card :from_entity_id card-id:to_entity_type :table :to_entity_id (mt/id :orders)))))))-(deftest ^:sequential backfill-no-status-row-test+(deftest ^:synchronized backfill-no-status-row-test(testing "Entities with no dependency_status row yet get picked up and processed by the backfill"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -455,7 +455,7 @@(is (t2/exists? :model/Dependency :from_entity_type :card :from_entity_id card-id:to_entity_type :table :to_entity_id (mt/id :orders)))))))-(deftest ^:sequential has-stale-or-outdated?-counts-no-status-row-test+(deftest ^:synchronized has-stale-or-outdated?-counts-no-status-row-test(testing "has-stale-or-outdated? (backing /backfill-status) stays consistent with what the backfill processes"(backfill-all-existing-entities!)(mt/with-premium-features #{}@@ -472,7 +472,7 @@(is (false? (deps.dependency-status/has-stale-or-outdated?))"Expected no pending work once the card has been processed")))))-(deftest ^:sequential batch-size-zero-suppresses-event-triggers-but-stays-warm-test+(deftest ^:synchronized batch-size-zero-suppresses-event-triggers-but-stays-warm-test(testing "A non-positive batch size stops the job doing work, but leaves it on its slow periodic schedule so itresumes if the setting ever becomes positive. What it must not do is keep firing the 1-second event-driventrigger, which is what made a disabled job wake roughly once a second on a busy instance -- entity changes@@ -495,7 +495,7 @@(with-redefs [env/env (assoc env/env :mb-dependency-backfill-batch-size "5")](is (= 1 (scheduled-by dependencies.backfill/trigger-backfill-job!)))))))))-(deftest ^:sequential backfill-batch-shares-one-metadata-provider-test+(deftest ^:synchronized backfill-batch-shares-one-metadata-provider-test(testing "GHY-4251: every entity in a batch must share one MetadataProvider per database. Reading an entity attachesa provider to its query, so without a batch-scoped cache each entity gets a private one; native depcalculation then fills each with that database's table metadata and the batch retains one copy per entity,@@ -522,7 +522,7 @@;; satisfied by two separate caches and would not detect the regression.(is (= 1 (count (into #{} (map #(System/identityHashCode %)) @providers))))))))))-(deftest ^:sequential backfill-records-failure-for-fatal-error-test+(deftest ^:synchronized backfill-records-failure-for-fatal-error-test(testing "GHY-4251: a fatal Error must record the entity's failure before propagating. Only Exception was caught,so an OutOfMemoryError escaped without recording anything and the next run selected the identical batch --a crash loop that never made progress. Recording first means the entity backs off and eventually goes@@ -542,7 +542,7 @@(is (some? next_retry_at))(is (false? terminal))))))))-(deftest ^:sequential pending-retries-licence-states-test+(deftest ^:synchronized pending-retries-licence-states-test(testing "A pending retry keeps the backfill job scheduled, but only when the licence permits acting on it. A retrymarker is cleared by processing the entity -- on success via upsert-status!, or by going terminal pastmax-retries -- and both are gated on the feature, so without it the job could never resolve the condition@@ -571,7 +571,7 @@(testing "definitively unlicensed: not actionable"(is (false? (actionable? false))))))))-(deftest ^:sequential backfill-records-failure-for-never-processed-entity-test+(deftest ^:synchronized backfill-records-failure-for-never-processed-entity-test(testing "An entity with no dependency_status row yet must still get a failure recorded when it fails. Such entitiesare explicitly selected for processing (instances-for-dependency-calculation matches a null status row), soon a first backfill every entity is in this state -- exactly the population most likely to fail on a large@@ -590,7 +590,7 @@(is (= 1 fail_count))(is (some? next_retry_at))))))))-(deftest ^:sequential fatal-error-still-reschedules-test+(deftest ^:synchronized fatal-error-still-reschedules-test(testing "A failure must not leave the job unscheduled. The job is one-shot self-rescheduling with no cronbackstop, so an Error propagating out of the batch skipped schedule-run! entirely and the chain endeduntil a content-change event or a restart. A real OutOfMemoryError usually takes the process with it anddiff --git a/enterprise/backend/test/metabase_enterprise/dependencies/task/entity_check_test.clj b/enterprise/backend/test/metabase_enterprise/dependencies/task/entity_check_test.cljindex 65ffa1b7e91..9ac1057c497 100644--- a/enterprise/backend/test/metabase_enterprise/dependencies/task/entity_check_test.clj+++ b/enterprise/backend/test/metabase_enterprise/dependencies/task/entity_check_test.clj@@ -12,7 +12,7 @@(set! *warn-on-reflection* true)-(deftest ^:sequential batch-size-zero-suppresses-event-triggers-but-stays-warm-test+(deftest ^:synchronized batch-size-zero-suppresses-event-triggers-but-stays-warm-test(testing "A non-positive batch size stops the job doing work, but leaves it on its slow periodic schedule so itresumes if the setting ever becomes positive. What it must not do is keep firing the 1-second event-driventrigger: entity changes fire it, and it never consulted the batch size, so a disabled job woke roughly once@@ -35,7 +35,7 @@(with-redefs [env/env (assoc env/env :mb-dependency-entity-check-batch-size "5")](is (= 1 (scheduled-by dependencies.entity-check/trigger-entity-check-job!)))))))))-(deftest ^:sequential post-run-reschedule-licence-states-test+(deftest ^:synchronized post-run-reschedule-licence-states-test(testing "The entity check job is a periodic checker with no terminal state, so it always queues another run. Thatis right while licensed, but check-entities! is gated on :dependencies, so without the feature the jobrescheduled itself every 30-90 minutes forever to do nothing at all.@@ -66,7 +66,7 @@[calls](into #{} (map (fn [args] (.getName (.getKey ^JobDetail (nth args 1))))) calls))-(deftest ^:sequential token-event-restarts-the-job-test+(deftest ^:synchronized token-event-restarts-the-job-test(testing "Setting a premium token must restart the entity check job. The backfill job derives:event/set-premium-embedding-token for this; entity check had no event wiring at all, so its only restartscame from content-change handlers. Enabling the feature on an idle instance left the periodic checker deaddiff --git a/enterprise/backend/test/metabase_enterprise/entity_retrieval/core_test.clj b/enterprise/backend/test/metabase_enterprise/entity_retrieval/core_test.cljindex da427d0695f..86bbfae6c1a 100644--- a/enterprise/backend/test/metabase_enterprise/entity_retrieval/core_test.clj+++ b/enterprise/backend/test/metabase_enterprise/entity_retrieval/core_test.clj@@ -343,7 +343,7 @@(is (=? {:dependencies deps, :index {:status :missing}}(entity-retrieval.core/retrieval-status false))))))))))-(deftest ^:sequential entity-retrieval-available?-requires-a-populated-index-test+(deftest ^:synchronized entity-retrieval-available?-requires-a-populated-index-test(testing "the curated tool is offered only once the index has documents (else the nlq profile falls back)"(when semantic.db.datasource/db-url(mt/with-premium-features #{:library :library-retrieval}@@ -377,7 +377,7 @@(index-table/vectors-table) ", "(index-table/meta-table))]))))))))))-(deftest ^:sequential ranks-by-similarity-test+(deftest ^:synchronized ranks-by-similarity-test(testing "search ranks library documents by cosine similarity, nearest first"(when semantic.db.datasource/db-url(mt/with-premium-features #{:library :library-retrieval}@@ -419,7 +419,7 @@(mt/user-http-request :crowberto :put 200 (format "osi/ai-context/%s/%d" entity-type entity-local-id){:ai_context ai-context}))-(deftest ^:sequential crud-api-to-tool-end-to-end-test+(deftest ^:synchronized crud-api-to-tool-end-to-end-test(testing "CRUD API write -> reconcile -> pgvector -> retrieve_library_entities tool, end to end";; Self-gated on MB_PGVECTOR_DB_URL — CI without semantic-search infra skips this; locally with the;; dev pgvector running it exercises the whole pipeline. Uses the mock embedding model (4-dim,@@ -475,7 +475,7 @@(index-table/vectors-table) ", "(index-table/meta-table))]))))))))))))-(deftest ^:sequential doc-type-boost-breaks-ties-test+(deftest ^:synchronized doc-type-boost-breaks-ties-test(testing "on a distance tie, a name match outranks a synonym match (blended ORDER BY, not raw NN)"(when semantic.db.datasource/db-url(mt/with-premium-features #{:library :library-retrieval}@@ -511,7 +511,7 @@(index-table/vectors-table) ", "(index-table/meta-table))]))))))))))))-(deftest ^:sequential search-degrades-on-dimension-mismatch-test+(deftest ^:synchronized search-degrades-on-dimension-mismatch-test;; A post-upgrade embedding-dimension change leaves the query vector incompatible with the index column;; until the next reconcile rebuilds it; search must degrade to [] rather than throw in that window.(testing "an index/query vector dimension mismatch degrades search to [] instead of throwing"diff --git a/enterprise/backend/test/metabase_enterprise/entity_retrieval/reconcile_test.clj b/enterprise/backend/test/metabase_enterprise/entity_retrieval/reconcile_test.cljindex c4dd5ca27b6..ae701e54a98 100644--- a/enterprise/backend/test/metabase_enterprise/entity_retrieval/reconcile_test.clj+++ b/enterprise/backend/test/metabase_enterprise/entity_retrieval/reconcile_test.clj@@ -95,7 +95,7 @@(index-table/vectors-table) ", "(index-table/meta-table))])))))))-(deftest ^:sequential with-index-read-lock-contention-integration-test+(deftest ^:synchronized with-index-read-lock-contention-integration-test(when semantic.db.datasource/db-url(let [ds (semantic.db.datasource/ensure-initialized-data-source!)lock-id (var-get #'reconcile/reconcile-lock-id)@@ -136,7 +136,7 @@[(format "SELECT reconciled_at FROM \"%s\" WHERE id = 1" (index-table/meta-table))]{:builder-fn jdbc.rs/as-unqualified-lower-maps})))-(deftest ^:sequential reconcile-lifecycle-test+(deftest ^:synchronized reconcile-lifecycle-test;; :library lets us publish a Table into a library-data collection; the reconcile enumerates the;; library tree via collections/library-collection + descendant-ids, so we build a real library root.(mt/with-premium-features #{:library :library-retrieval}@@ -192,7 +192,7 @@(is (empty? (docs-for ds "table" table-id)))(is (seq (docs-for ds "metric" metric-id)) "the metric is untouched")))))))-(deftest ^:sequential reconcile!-runs-to-completion-test+(deftest ^:synchronized reconcile!-runs-to-completion-test(testing "reconcile! blocks until the run completes and a second run is idempotent"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -212,7 +212,7 @@(testing "a second run writes nothing"(is (=? {:inserted 0 :deleted 0} (reconcile/reconcile! ds (constantly model))))))))))))-(deftest ^:sequential rebuild-on-model-change-test+(deftest ^:synchronized rebuild-on-model-change-test(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds](let [model semantic.tu/mock-embedding-model]@@ -242,7 +242,7 @@(testing "the rebuild heals the meta row, so it doesn't recur on the next sync"(is (= :ok (index-table/ensure-tables! ds new-model)))))))))))-(deftest ^:sequential embedding-space-change-rebuilds-test+(deftest ^:synchronized embedding-space-change-rebuilds-test(with-isolated-index [ds](let [model semantic.tu/mock-embedding-modelchanged-space (update model :embedding-space-id str "-changed")]@@ -259,7 +259,7 @@(is (= :compatible (index-table/index-status ds changed-space)))(is (= :ok (index-table/ensure-tables! ds changed-space)))))))-(deftest ^:sequential version-1-meta-upgrade-rebuilds-test+(deftest ^:synchronized version-1-meta-upgrade-rebuilds-test(with-isolated-index [ds](let [model semantic.tu/mock-embedding-model](jdbc/execute! ds [(format (str "CREATE TABLE \"%s\" ("@@ -308,7 +308,7 @@(index-table/meta-table)]{:builder-fn jdbc.rs/as-unqualified-lower-maps}))))))))-(deftest ^:sequential measures-and-segments-indexed-and-hydrated-test+(deftest ^:synchronized measures-and-segments-indexed-and-hydrated-test(testing "measures/segments on a published library table are indexed and hydrate with parent-table context"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -345,7 +345,7 @@:database_id (mt/id) :base_table_id orders :portable_entity_id string?}(get by-key ["segment" segment-id])))))))))))))-(deftest ^:sequential failed-insert-spares-only-that-entitys-orphans-test+(deftest ^:synchronized failed-insert-spares-only-that-entitys-orphans-test(testing "a failed insert spares that entity's orphans; an unrelated entity's orphans still GC"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -370,7 +370,7 @@(testing "the entity that left the library is still GC'd (no failed insert of its own)"(is (empty? (docs-for ds "table" leaving))))))))))-(deftest ^:sequential reconcile-entity!-targets-one-slice-test+(deftest ^:synchronized reconcile-entity!-targets-one-slice-test(testing "reconcile-entity! reconciles only the given entity's docs, leaving other entities untouched"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -393,7 +393,7 @@(frequencies (map :doc_type (docs-for ds "table" a-id)))))(is (= b-before (set (map :doc_id (docs-for ds "table" b-id)))) "B untouched")))))))))))-(deftest ^:sequential reconcile-entity!-leaving-library-deletes-all-test+(deftest ^:synchronized reconcile-entity!-leaving-library-deletes-all-test(testing "reconcile-entity! on an entity that has left the library GCs all of its docs"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -412,7 +412,7 @@(is (empty? (docs-for ds "table" a-id)) "A (no longer a member) is GC'd")(is (= b-before (set (map :doc_id (docs-for ds "table" b-id)))) "B untouched"))))))))))-(deftest ^:sequential reconcile-entity!-ai-context-removal-keeps-name-test+(deftest ^:synchronized reconcile-entity!-ai-context-removal-keeps-name-test(testing "removing an entity's ai_context and reconciling it GCs synonym/example docs but keeps name/description"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -432,7 +432,7 @@(is (= {"name" 1 "description" 1} (frequencies (map :doc_type (docs-for ds "table" a-id))))"the synonym docs are GC'd; name + description remain"))))))))-(deftest ^:sequential reconcile!-keeps-ai-context-across-a-card-type-flip-test+(deftest ^:synchronized reconcile!-keeps-ai-context-across-a-card-type-flip-test(testing "a full reconcile matches ai_context by entity class, so relabelling a card keeps its synonyms"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -454,7 +454,7 @@(is (= {"name" 1 "synonym" 2} (frequencies (map :doc_type (docs-for ds "model" card-id))))"the ai_context (stored under metric) is matched by class and kept, re-keyed under model"))))))))))-(deftest ^:sequential library-entity-matches-library-entities-test+(deftest ^:synchronized library-entity-matches-library-entities-test(testing "library-entity (point lookup) agrees with library-entities (full scan) for members and non-members"(mt/with-premium-features #{:library :library-retrieval}(collections.tu/with-library [{data :data metrics :metrics}]@@ -485,7 +485,7 @@(collections.tu/with-library [{library :library}](is (contains? (set (#'reconcile/library-ids library)) (:id library)))))))-(deftest ^:sequential reconcile-entity!-on-first-build-repopulates-whole-library-test+(deftest ^:synchronized reconcile-entity!-on-first-build-repopulates-whole-library-test(testing "a targeted reconcile that creates the index (first caller, empty table) repopulates the whole library"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]@@ -503,7 +503,7 @@(is (seq (docs-for ds "table" b-id))"B indexed too: the empty-index build escalated to a full repopulate"))))))))-(deftest ^:sequential reconcile-entity!-on-rebuild-repopulates-whole-library-test+(deftest ^:synchronized reconcile-entity!-on-rebuild-repopulates-whole-library-test(testing "a targeted reconcile that triggers a model/format rebuild repopulates the whole library, not just the one entity"(mt/with-premium-features #{:library :library-retrieval}(with-isolated-index [ds]diff --git a/enterprise/backend/test/metabase_enterprise/harbormaster/client_test.clj b/enterprise/backend/test/metabase_enterprise/harbormaster/client_test.cljindex 90b0a422c9c..b7594c7a5cc 100644--- a/enterprise/backend/test/metabase_enterprise/harbormaster/client_test.clj+++ b/enterprise/backend/test/metabase_enterprise/harbormaster/client_test.clj@@ -65,7 +65,7 @@(catch Exception e(ex-data e))))))-(deftest ^:sequential call-error-ex-data-test+(deftest ^:synchronized call-error-ex-data-test(testing "the Store's HTTP status and decoded error body are both available on ex-data"(is (= {:status 400:upsert-add-ons "This organization already has a product with the same metric-name."}diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/card_api_test.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/card_api_test.cljindex b5d99b41f58..c69aeddde98 100644--- a/enterprise/backend/test/metabase_enterprise/remote_sync/card_api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/card_api_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.remote-sync.card-api-test+(ns ^:synchronized metabase-enterprise.remote-sync.card-api-test{:clj-kondo/config '{:linters {:deprecated-var {:exclude {metabase.test.data/mbql-query {:namespaces [metabase-enterprise.remote-sync.card-api-test]}}}}}}(:require[clojure.test :refer :all]diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/collection_api_test.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/collection_api_test.cljindex bfc02204f61..e92252e9e1f 100644--- a/enterprise/backend/test/metabase_enterprise/remote_sync/collection_api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/collection_api_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.remote-sync.collection-api-test+(ns ^:synchronized metabase-enterprise.remote-sync.collection-api-test{:clj-kondo/config '{:linters {:deprecated-var {:exclude {metabase.test.data/mbql-query {:namespaces [metabase-enterprise.remote-sync.collection-api-test]}}}}}}(:require[clojure.string :as str]diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/dashboard_api_test.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/dashboard_api_test.cljindex 0cdd4b57ab1..6aba73e8067 100644--- a/enterprise/backend/test/metabase_enterprise/remote_sync/dashboard_api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/dashboard_api_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.remote-sync.dashboard-api-test+(ns ^:synchronized metabase-enterprise.remote-sync.dashboard-api-test{:clj-kondo/config '{:linters {:deprecated-var {:exclude {metabase.test.data/mbql-query {:namespaces [metabase-enterprise.remote-sync.dashboard-api-test]}}}}}}(:require[clojure.string :as str]diff --git a/enterprise/backend/test/metabase_enterprise/semantic_search/core_test.clj b/enterprise/backend/test/metabase_enterprise/semantic_search/core_test.cljindex 8cf3bc71a0e..ef7e3881121 100644--- a/enterprise/backend/test/metabase_enterprise/semantic_search/core_test.clj+++ b/enterprise/backend/test/metabase_enterprise/semantic_search/core_test.clj@@ -36,7 +36,7 @@(constantly semantic.tu/mock-embedding-model)](is (true? (semantic.core/supported?))))))))-(deftest ^:sequential build-hnsw-index-async-deduplicates-local-builds-test+(deftest ^:synchronized build-hnsw-index-async-deduplicates-local-builds-test(let [started (CountDownLatch. 1)release (CountDownLatch. 1)reset-complete (CountDownLatch. 1)@@ -65,7 +65,7 @@(.countDown release)))(is (.await reset-complete 5 TimeUnit/SECONDS) "the build future reset its local gate")))))-(deftest ^:sequential repair-snapshot-precedes-canonical-document-read-test+(deftest ^:synchronized repair-snapshot-precedes-canonical-document-read-test(let [events (atom [])active-state (atom [nil {:metadata-row {:id 17}}])documents (map (fn [document]diff --git a/enterprise/backend/test/metabase_enterprise/semantic_search/db/store_health_test.clj b/enterprise/backend/test/metabase_enterprise/semantic_search/db/store_health_test.cljindex 02d9fac3206..bd10ba88989 100644--- a/enterprise/backend/test/metabase_enterprise/semantic_search/db/store_health_test.clj+++ b/enterprise/backend/test/metabase_enterprise/semantic_search/db/store_health_test.clj@@ -154,7 +154,7 @@semantic.db.datasource/pgvector-mode #(throw (ex-info "must not probe" {}))](is (=? {:mode :unavailable, :connected? false, :resolved? false} (probe)))))))-(deftest ^:sequential live-probe-is-never-replaced-test+(deftest ^:synchronized live-probe-is-never-replaced-test(testing "a probe stuck on an unresponsive database cannot be cancelled, so no replacement is admitted"(let [probe-future @#'semantic.store-health/readiness-probe-futurerequest @#'semantic.store-health/request-pgvector-readiness-refresh!@@ -249,7 +249,7 @@(check)(is (= 2 @collects))))))-(deftest ^:sequential pull-collector-refreshes-pgvector-metrics-on-each-instance-test+(deftest ^:synchronized pull-collector-refreshes-pgvector-metrics-on-each-instance-test(let [probe-future @#'semantic.store-health/readiness-probe-futureprobe @#'semantic.store-health/last-readiness-probeprior-probe @probediff --git a/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_circuit_breaker_test.clj b/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_circuit_breaker_test.cljindex 5aa517beb51..cc50496eeac 100644--- a/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_circuit_breaker_test.clj+++ b/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_circuit_breaker_test.clj@@ -61,7 +61,7 @@(is (= "https://openai.example/v1/embeddings"(semantic.embedding/embedder-circuit-endpoint {:provider "openai"}))))))-(deftest ^:sequential request-failure-does-not-change-service-failure-history-test+(deftest ^:synchronized request-failure-does-not-change-service-failure-history-test(testing "request- and model-specific failures neither trip the circuit nor reset service-failure history"(let [breaker (dh.cb/circuit-breaker {:failure-threshold 2 :success-threshold 1 :delay-ms 60000})](with-redefs [semantic.embedding/embedder-circuit-breakers (atom {test-endpoint breaker})]@@ -74,7 +74,7 @@(is (thrown? Exception (call-through boom)))(is (= :open (circuit-state)))))))-(deftest ^:sequential unexpected-dimensions-do-not-trip-breaker-test+(deftest ^:synchronized unexpected-dimensions-do-not-trip-breaker-test(testing "dimensions are model-specific, so an otherwise valid response does not count as a service failure"(with-redefs [semantic.embedding/embedder-circuit-breakers(atom {test-endpoint (dh.cb/circuit-breaker@@ -89,7 +89,7 @@(ex-data e)))))(is (= :closed (circuit-state))))))-(deftest ^:sequential invalid-vector-values-trip-breaker-test+(deftest ^:synchronized invalid-vector-values-trip-breaker-test(testing "nonnumeric and non-finite values are invalid service responses"(doseq [[label value] [["nonnumeric" ::not-a-number]["NaN" Double/NaN]@@ -107,7 +107,7 @@e))))(is (= :open (circuit-state))))))))-(deftest ^:sequential opens-after-threshold-and-fast-fails-test+(deftest ^:synchronized opens-after-threshold-and-fast-fails-test(testing "consecutive failures trip the breaker; while open, calls fast-fail with the mapped 502 ex-info";; A fresh breaker (short threshold, stays open) so the test is isolated from the process-wide default.(with-redefs [semantic.embedding/embedder-circuit-breakers@@ -120,7 +120,7 @@(try (call-through (constantly :never)) nil(catch clojure.lang.ExceptionInfo e (ex-data e))))))))-(deftest ^:sequential circuit-open-fast-failure-does-not-log-request-error-test+(deftest ^:synchronized circuit-open-fast-failure-does-not-log-request-error-test(testing "the breaker transition reports the outage without an error log for every guarded request"(with-redefs [semantic.embedding/embedder-circuit-breakers(atom {test-endpoint (dh.cb/circuit-breaker@@ -141,7 +141,7 @@(ex-data e)))))(is (empty? (messages)))))))-(deftest ^:sequential throwable-releases-half-open-permit-test+(deftest ^:synchronized throwable-releases-half-open-permit-test(testing "a JVM-level failure cannot strand the breaker's only half-open trial permit"(let [breaker (dh.cb/circuit-breaker{:failure-threshold 1 :success-threshold 1 :delay-ms 0})]@@ -151,7 +151,7 @@(is (= :ok (call-through (constantly :ok))))(is (= :closed (circuit-state)))))))-(deftest ^:sequential interruption-releases-half-open-permit-test+(deftest ^:synchronized interruption-releases-half-open-permit-test(testing "an interruption propagates unchanged and cannot strand the breaker's half-open trial permit"(let [breaker (dh.cb/circuit-breaker{:failure-threshold 1 :success-threshold 1 :delay-ms 0})@@ -167,7 +167,7 @@(is (= :ok (call-through (constantly :ok))))(is (= :closed (circuit-state)))))))-(deftest ^:sequential local-bookkeeping-failure-does-not-trip-breaker-test+(deftest ^:synchronized local-bookkeeping-failure-does-not-trip-breaker-test(testing "a token-tracking failure propagates without being attributed to the embedding service"(with-redefs [semantic.embedding/embedder-circuit-breakers(atom {"https://example.test/v1/embeddings"@@ -192,7 +192,7 @@:snowplow? false})))(is (= :closed (circuit-state "https://example.test/v1/embeddings")))))))-(deftest ^:sequential malformed-response-trips-breaker-test+(deftest ^:synchronized malformed-response-trips-breaker-test(testing "a successful HTTP response is not a circuit success until its vectors are validated"(let [endpoint "https://example.test/v1/embeddings"](with-redefs [semantic.embedding/embedder-circuit-breakers@@ -213,7 +213,7 @@:record-tokens? false})))(is (= :open (circuit-state endpoint))))))))-(deftest ^:sequential endpoint-circuits-are-isolated-test+(deftest ^:synchronized endpoint-circuits-are-isolated-test(let [endpoint-a "https://a.example/v1/embeddings"endpoint-b "https://b.example/v1/embeddings"breaker #(dh.cb/circuit-breaker@@ -225,7 +225,7 @@(is (= :ok (call-through (constantly :ok) :endpoint endpoint-b)))(is (= :closed (circuit-state endpoint-b))))))-(deftest ^:sequential kill-switch-bypasses-breaker-test+(deftest ^:synchronized kill-switch-bypasses-breaker-test(testing "with the breaker disabled the thunk runs directly: raw exception propagates, breaker untouched"(with-redefs [semantic.embedding/embedder-circuit-breakers(atom {test-endpoint (dh.cb/circuit-breaker@@ -235,7 +235,7 @@(try (call-through boom) nil (catch clojure.lang.ExceptionInfo e (ex-data e)))))(is (= :closed (circuit-state)) "a bypassed breaker records no failures")))))-(deftest ^:sequential probe-bypass-flag-bypasses-breaker-test+(deftest ^:synchronized probe-bypass-flag-bypasses-breaker-test(testing "*bypass-circuit-breaker* runs the thunk directly, without consulting or tripping the breaker"(with-redefs [semantic.embedding/embedder-circuit-breakers(atom {test-endpoint (dh.cb/circuit-breaker@@ -244,7 +244,7 @@(is (thrown? clojure.lang.ExceptionInfo (call-through boom)))(is (= :closed (circuit-state)))))))-(deftest ^:sequential circuit-untrusted?-covers-half-open-test+(deftest ^:synchronized circuit-untrusted?-covers-half-open-test(testing "embedder-circuit-untrusted? is true whenever the enabled breaker isn't closed -- both :open and:half-open -- so the health verdict can't flap as the breaker cycles between them"(mt/with-temporary-setting-values [semantic-search-embedder-circuit-breaker-enabled true]@@ -267,7 +267,7 @@(is (string? (embedding-health/embedding-problem)))(is (= 1 @recoveries)))))-(deftest ^:sequential open-circuit-recovery-waits-for-the-trial-window-test+(deftest ^:synchronized open-circuit-recovery-waits-for-the-trial-window-test(let [breaker (dh.cb/circuit-breaker {:failure-threshold 1 :success-threshold 1 :delay-ms 60000})scheduled (atom nil)](with-redefs [semantic.embedding/embedder-circuit-breakers (atom {test-endpoint breaker})@@ -279,7 +279,7 @@(embedding-health/request-circuit-recovery!)(is (fn? @scheduled) "recovery is deferred until after the breaker permits a trial"))))))-(deftest ^:sequential recovery-scheduling-failure-releases-claim-test+(deftest ^:synchronized recovery-scheduling-failure-releases-claim-test(let [state (atom {:running? false, :last-start-ns nil})](with-redefs [embedding-health/recovery-state state](mt/with-dynamic-fn-redefs@@ -288,7 +288,7 @@(is (nil? (embedding-health/request-circuit-recovery!)))(is (false? (:running? @state)))))))-(deftest ^:sequential failed-idle-recovery-schedules-another-trial-test+(deftest ^:synchronized failed-idle-recovery-schedules-another-trial-test(let [state (atom {:running? true, :last-start-ns 0})retries (atom 0)](with-redefs [embedding-health/recovery-state state]@@ -307,7 +307,7 @@(#'embedding-health/request-recovery-on-open! :open)(is (= 1 @requests)))))-(deftest ^:sequential state-change-persists-affected-checks-test+(deftest ^:synchronized state-change-persists-affected-checks-test(testing "a breaker state transition runs the registered hooks, persisting both embedder-dependent healthchecks immediately"(let [persisted (atom [])@@ -320,7 +320,7 @@(is (.await completed 5 TimeUnit/SECONDS) "state-change hooks did not finish")(is (= #{:semantic-search-index :nlq-retrieval} (set @persisted)))))))-(deftest ^:sequential state-changes-run-serially-in-arrival-order-test+(deftest ^:synchronized state-changes-run-serially-in-arrival-order-test(testing "transitions queue through one agent: a later transition's hooks can't overtake an earliertransition whose hook is still blocked (e.g. on a probe against a down service), so a slowpre-recovery check can't persist its stale result after the recovery one"diff --git a/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_test.clj b/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_test.cljindex 7e308388f15..301eef37d26 100644--- a/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_test.clj+++ b/enterprise/backend/test/metabase_enterprise/semantic_search/embedding_test.clj@@ -434,7 +434,7 @@(filter #(= "embedding_generation" (get-in % [:data "tag"]))))](is (empty? events))))))))-(deftest ^:sequential token-tracking-write-test+(deftest ^:synchronized token-tracking-write-test(mt/with-premium-features #{:semantic-search}(when (string? (not-empty (:mb-pgvector-db-url env/env)))(doseq [provider ["openai" "ai-service"]]diff --git a/enterprise/backend/test/metabase_enterprise/semantic_search/health_test.clj b/enterprise/backend/test/metabase_enterprise/semantic_search/health_test.cljindex 760b0547cee..e030cbb8ed4 100644--- a/enterprise/backend/test/metabase_enterprise/semantic_search/health_test.clj+++ b/enterprise/backend/test/metabase_enterprise/semantic_search/health_test.clj@@ -195,9 +195,9 @@;; Tests the raw probe (`embedding-service-reachable?` is TTL-memoized, so calling it across cases would;; return a stale cached result).-;; ^:sequential: redefs the process-global `get-configured-model` / `get-embedding` via with-redefs, so it+;; ^:synchronized: redefs the process-global `get-configured-model` / `get-embedding` via with-redefs, so it;; must not run concurrently with other tests (e.g. entity-retrieval-available? reads get-configured-model).-(deftest ^:sequential probe-embedding-service-test+(deftest ^:synchronized probe-embedding-service-test(testing "a successful embed reads as reachable; the probe bypasses the breaker and silences snowplow"(let [seen (atom nil)];; get-embedding is a multimethod; with-dynamic-fn-redefs can't patch those, so with-redefs is required.@@ -215,7 +215,7 @@(is (=? {:reachable? false :error "connection refused"}(#'embedding-health/probe-embedding-service))))))-(deftest ^:sequential breaker-transition-probe-cache-test+(deftest ^:synchronized breaker-transition-probe-cache-test(testing "open and half-open transitions reuse the probe; recovery clears it"(let [probes (atom 0)];; get-embedding is a multimethod; with-dynamic-fn-redefs can't patch those, so with-redefs is required.@@ -234,7 +234,7 @@(is (= 2 @probes) "recovery busts the cache so the persisted row can't be a stale 'unreachable'")(memoize/memo-clear! @#'embedding-health/embedding-service-reachable?*))))))-(deftest ^:sequential circuit-recovery-probe-test+(deftest ^:synchronized circuit-recovery-probe-test(testing "recovery runs off-thread and supplies enough successful trials to close an untrusted circuit"(let [calls (atom 0)completed (CountDownLatch. 1)@@ -401,7 +401,7 @@:message "Index staleness unavailable: database clock precedes a pending change."}(#'semantic.health/semantic-staleness)))))-(deftest ^:sequential report-repair-metrics!-test+(deftest ^:synchronized report-repair-metrics!-test(mt/with-dynamic-fn-redefs [health-inspector/enabled? (constantly false)](testing "a stored snapshot refreshes the garbage gauge immediately"(let [calls (atom [])@@ -481,7 +481,7 @@(is (thrown? InterruptedException(semantic.health/report-repair-metrics! {:orphan-count 3})))))-(deftest ^:sequential refresh-clears-garbage-when-inactive-test+(deftest ^:synchronized refresh-clears-garbage-when-inactive-test(testing "refresh NaNs a previously-emitted semantic garbage series when there's no active index, since norepair push will clear it (the collector reads N/A)"(let [calls (atom [])]diff --git a/enterprise/backend/test/metabase_enterprise/support_access_grants/session_integration_test.clj b/enterprise/backend/test/metabase_enterprise/support_access_grants/session_integration_test.cljindex f4920fb3a76..ad19611c8c7 100644--- a/enterprise/backend/test/metabase_enterprise/support_access_grants/session_integration_test.clj+++ b/enterprise/backend/test/metabase_enterprise/support_access_grants/session_integration_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase-enterprise.support-access-grants.session-integration-test+(ns ^:synchronized metabase-enterprise.support-access-grants.session-integration-test"Tests for session API integration with support access grants.Tests the fallback mechanism in /api/session/reset_password and /api/session/password_reset_token_validthat tries support-access-grant provider first, then falls back to emailed-secret-password-reset."diff --git a/modules/drivers/clickhouse/test/metabase/driver/clickhouse/index_test.clj b/modules/drivers/clickhouse/test/metabase/driver/clickhouse/index_test.cljindex ed7a590739a..277a57d0afd 100644--- a/modules/drivers/clickhouse/test/metabase/driver/clickhouse/index_test.clj+++ b/modules/drivers/clickhouse/test/metabase/driver/clickhouse/index_test.clj@@ -100,7 +100,7 @@;;; --------------------------------------- Live execute path ----------------------------------------;; All tables here land in the connection's default database (created unqualified), so the catalog lookups filter on-;; database = "default". Tests are :synchronized, not :parallel: they create and drop tables in that shared database.+;; database = "default". Tests use `^:synchronized`: they create and drop tables in that shared database.(defn- sorting-key"The MergeTree sorting key of `db`.`table` as ClickHouse reports it, e.g. \"a, b\" (or \"\" for an unsorted table)."diff --git a/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj b/modules/drivers/snowflake/test/metabase/driver/snowflake_test.cljindex 03627415746..f4473d6deaf 100644--- a/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj+++ b/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj@@ -93,7 +93,7 @@(binding [sync-util/*log-exceptions-and-continue?* false](thunk))))-(deftest ^:sequential sanity-check-test+(deftest ^:synchronized sanity-check-test(mt/test-driver:snowflake(mt/dataset@@ -103,7 +103,7 @@(mt/run-mbql-query attempts{:aggregation [[:count]]})))))))-(deftest ^:sequential describe-fields-test+(deftest ^:synchronized describe-fields-test(mt/test-driver:snowflake(is (=? [{:name "id"@@ -300,7 +300,7 @@(is (= ["SELECT TRUE AS \"_\" FROM \"PUBLIC\".\"table\" WHERE 1 <> 1 LIMIT 0"](sql-jdbc.describe-database/simple-select-probe-query :snowflake "PUBLIC" "table")))))))-(deftest ^:sequential have-select-privilege?-test+(deftest ^:synchronized have-select-privilege?-test(mt/test-driver :snowflake(qp.store/with-metadata-provider (mt/id)(sql-jdbc.execute/do-with-connection-with-options@@ -310,7 +310,7 @@(fn [^java.sql.Connection conn](is (sql-jdbc.sync/have-select-privilege? :snowflake conn "PUBLIC" "venues")))))))-(deftest ^:sequential can-set-schema-in-additional-options+(deftest ^:synchronized can-set-schema-in-additional-options(mt/test-driver :snowflake(qp.store/with-metadata-provider (mt/id)(let [schema "INFORMATION_SCHEMA"@@ -325,7 +325,7 @@(is (= [{:s schema}] (jdbc/query spec ["select CURRENT_SCHEMA() s"])))(is (= 1 (count (jdbc/query spec ["select * from \"TABLES\" limit 1"])))))))))-(deftest ^:sequential additional-options-test+(deftest ^:synchronized additional-options-test(mt/test-driver:snowflake(let [existing-details (dissoc (:details (mt/db)) :password)]@@ -526,7 +526,7 @@(testing "but still escapes for the JDBC metadata call, which treats them as patterns"(is (= ["MY_DB" "RAW\\_DATA" "MY\\_TABLE"] @fk-args))))))-(deftest ^:sequential describe-table-fields-uuid-column-test+(deftest ^:synchronized describe-table-fields-uuid-column-test(mt/test-driver :snowflake(testing "Snowflake tables with UUID columns should sync successfully (#71595)"(let [db-name (#'driver.snowflake/db-name (mt/db))@@ -566,7 +566,7 @@;; Five related repro phases (v1-v5) share Snowflake connection setup and table-name lifecycle.;; Splitting would multiply CI Snowflake setup cost. Kondo's warning is acknowledged.^{:clj-kondo/ignore [:metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests]}- (deftest ^:sequential ^:synchronized create-or-replace-table-updates-effective-type-test+ (deftest ^:synchronized create-or-replace-table-updates-effective-type-test(mt/test-driver :snowflake(testing "GHY-3388: when a column's database type changes via CREATE OR REPLACE TABLE(e.g. TEXT -> NUMBER via TRY_TO_NUMBER), sync should update effective_type to match@@ -742,7 +742,7 @@(u/ignore-exceptions(run-sql! [(format "DROP TABLE IF EXISTS %s;" qualified)])))))))))-(deftest ^:sequential describe-table-test+(deftest ^:synchronized describe-table-test(mt/test-driver :snowflake(testing "make sure describe-table uses the NAME FROM DETAILS too"(is (=? {:name "categories"@@ -767,7 +767,7 @@(-> (driver/describe-table :snowflake (assoc (mt/db) :name "ABC") (t2/select-one :model/Table :id (mt/id :categories)))(update :fields (partial sort-by :name))))))))-(deftest ^:sequential describe-fks-test+(deftest ^:synchronized describe-fks-test(mt/test-driver :snowflake(testing "make sure describe-fks uses the NAME FROM DETAILS too"(let [table (t2/select-one [:model/Table :schema :name] :id (mt/id :venues))]@@ -1162,7 +1162,7 @@#t "2024-04-25T14:44:00-07:00""2024-04-25T14:44:00-07:00")))-(deftest ^:sequential zoned-date-time-parameter-test+(deftest ^:synchronized zoned-date-time-parameter-test(test-temporal-instance#t "2024-04-25T14:44:00-07:00[US/Pacific]""2024-04-25T21:44:00Z"))@@ -1367,7 +1367,7 @@(is (not (contains? params "ROLE")))(is (contains? params "ASDFROLE")))))-(deftest ^:sequential filter-on-variant-column-test+(deftest ^:synchronized filter-on-variant-column-test(testing "We should still let you do various filter types on VARIANT (anything) columns (#45206)"(mt/test-driver :snowflake(let [variant-base-type (sql-jdbc.sync/database-type->base-type :snowflake :VARIANT)diff --git a/test/metabase/documents/view_log_test.clj b/test/metabase/documents/view_log_test.cljindex 8820438811d..99e14cb5021 100644--- a/test/metabase/documents/view_log_test.clj+++ b/test/metabase/documents/view_log_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase.documents.view-log-test+(ns ^:synchronized metabase.documents.view-log-test(:require[clojure.test :refer :all][java-time.api :as t]diff --git a/test/metabase/driver/postgres_test.clj b/test/metabase/driver/postgres_test.cljindex a43ec7dbab8..fba98310d43 100644--- a/test/metabase/driver/postgres_test.clj+++ b/test/metabase/driver/postgres_test.clj@@ -197,7 +197,7 @@;;; ------------------------------------------- Tests for sync edge cases ---------------------------------------------(deftest ^:sequential edge-case-identifiers-test+(deftest ^:synchronized edge-case-identifiers-test(mt/test-driver :postgres(testing "Make sure that Tables / Fields with dots in their names get escaped properly"(mt/dataset dots-in-namesdiff --git a/test/metabase/embeddings/embedder_plugin_artifact_test.clj b/test/metabase/embeddings/embedder_plugin_artifact_test.cljindex ca9b937ca2a..1164bf3ca21 100644--- a/test/metabase/embeddings/embedder_plugin_artifact_test.clj+++ b/test/metabase/embeddings/embedder_plugin_artifact_test.clj@@ -138,7 +138,7 @@(catch clojure.lang.ExceptionInfo e e)))))"a catalog entry missing this architecture's export fails instead of hashing nil"))))-(deftest ^:sequential plugin-artifact-smoke-test+(deftest ^:synchronized plugin-artifact-smoke-test(if-not (= "true" (System/getenv "MB_EMBEDDER_ARTIFACT_TEST"))(testing "artifact smoke is enabled only in its dedicated CI process"(is true))diff --git a/test/metabase/explorations/queues_test.clj b/test/metabase/explorations/queues_test.cljindex 7e797dd48b8..7e1f37e9f4b 100644--- a/test/metabase/explorations/queues_test.clj+++ b/test/metabase/explorations/queues_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase.explorations.queues-test+(ns ^:synchronized metabase.explorations.queues-test"End-to-end tests for the exploration queues.`mq.tu/with-test-mq` starts the real subsystem on an in-memory backend and realizes every@@ -6,7 +6,7 @@`metabase.explorations.queues` — so these exercise the production wiring, not a stand-in: publish amessage, wait, and assert on what the handlers did.- Marked `^:synchronous` because `with-test-mq` installs its backend with `alter-var-root` — it is+ Marked `^:synchronized` because `with-test-mq` installs its backend with `alter-var-root` — it isprocess-global, so two of these running in parallel would clobber each other's backend.NOTE ON FIXTURES: these deliberately do NOT use `mt/with-temp`. It runs the body inside adiff --git a/test/metabase/indexes_rest/api_test.clj b/test/metabase/indexes_rest/api_test.cljindex 3b88bd2c4d9..d7e0c171606 100644--- a/test/metabase/indexes_rest/api_test.clj+++ b/test/metabase/indexes_rest/api_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase.indexes-rest.api-test+(ns ^:synchronized metabase.indexes-rest.api-test(:require[clojure.test :refer :all][metabase.driver]diff --git a/test/metabase/logger/api_test.clj b/test/metabase/logger/api_test.cljindex 66fd5296103..72feca6ef21 100644--- a/test/metabase/logger/api_test.clj+++ b/test/metabase/logger/api_test.clj@@ -54,7 +54,7 @@(testing "non-admins have no access"(mt/user-http-request :lucky :post 403 "logger/adjustment" {:duration 1, :duration_unit :days, :log_levels {"l" "debug"}})))-(deftest ^:sequential adjust-test+(deftest ^:synchronized adjust-test(let [trace-ns (str (random-uuid))fatal-ns (str (random-uuid))other-ns (str (random-uuid))@@ -107,7 +107,7 @@(logger/remove-ns-logger! fatal-ns)(logger/remove-ns-logger! other-ns)))))-(deftest ^:sequential delete-test+(deftest ^:synchronized delete-test(let [trace-ns (str (random-uuid))fatal-ns (str (random-uuid))log-levels {trace-ns :trace, fatal-ns :fatal}@@ -135,7 +135,7 @@(logger/remove-ns-logger! trace-ns)(logger/remove-ns-logger! fatal-ns)))))-(deftest ^:sequential invalid-adjustment-test+(deftest ^:synchronized invalid-adjustment-test(testing "invalid level"(is (= {:specific-errors{:log_levelsdiff --git a/test/metabase/mq/queue/outbox_test.clj b/test/metabase/mq/queue/outbox_test.cljindex 480dbe8160a..0ceea51c929 100644--- a/test/metabase/mq/queue/outbox_test.clj+++ b/test/metabase/mq/queue/outbox_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase.mq.queue.outbox-test+(ns ^:synchronized metabase.mq.queue.outbox-test(:require[clojure.test :refer :all][metabase.app-db.connection :as app-db.conn]diff --git a/test/metabase/mq/test_util.clj b/test/metabase/mq/test_util.cljindex 94d3af17fff..f4162a91ace 100644--- a/test/metabase/mq/test_util.clj+++ b/test/metabase/mq/test_util.clj@@ -283,7 +283,7 @@worker would simply never see the rebinding. A root swap is the only thing it observes.That swap is process-global for the duration of `body`, so a test using this must be marked- `^:synchronous`, exactly as it would if it reached for `with-redefs` directly.+ `^:synchronized`, exactly as it would if it reached for `with-redefs` directly.Prefer this over a bare `with-redefs` + inline `:clj-kondo/ignore` in queue tests. Stubbing ahandler's collaborators is a standing requirement of testing a queue, not a code smell, anddiff --git a/test/metabase/parameters/chain_filter_test.clj b/test/metabase/parameters/chain_filter_test.cljindex aa6ebac9646..327232ad034 100644--- a/test/metabase/parameters/chain_filter_test.clj+++ b/test/metabase/parameters/chain_filter_test.clj@@ -769,7 +769,7 @@clause))))(-> query :stages first :filters)))-(deftest ^:sequential chain-filter-preserves-required-partition-filter-on-joined-table-test+(deftest ^:synchronized chain-filter-preserves-required-partition-filter-on-joined-table-test;; `add-required-filters-if-needed` runs near the end of `chain-filter-mbql-query`, after joins are built. For;; tables that require a partition filter (currently BigQuery partitioned tables), it adds a `[:> partition-col _]`;; clause; when the partition column lives on a *joined* table, the clause references it through the join's alias.diff --git a/test/metabase/parameters/dashboard_test.clj b/test/metabase/parameters/dashboard_test.cljindex 53a59e0102d..987c01d44aa 100644--- a/test/metabase/parameters/dashboard_test.clj+++ b/test/metabase/parameters/dashboard_test.clj@@ -64,7 +64,7 @@{:values [[1] [2] [3]]}{:values [[4 "A"] [2 "B"] [5 "C"]]}])))))-(deftest ^:sequential dashboard-parameters+(deftest ^:synchronized dashboard-parameters(mt/dataset test-data(let [created-at (mt/id :orders :created_at)](mt/with-temp [:model/Card {card-id :id} {:dataset_query (mt/mbql-query orders)}@@ -87,7 +87,7 @@:type "date/all-options"}]})](is (= "completed" (:status response))))))))))-(deftest ^:sequential dashboard-remapping-multi-field-permissions-test+(deftest ^:synchronized dashboard-remapping-multi-field-permissions-test"Test for issue #47951: Dashboard filters should show remapped values even whenuser has view-data but not create-queries permissions on the target table."(testing "Dashboard parameter remapping with multi-field FK scenario"@@ -127,7 +127,7 @@(is (= [1 "Rustic Paper Wallet"](parameters.dashboard/dashboard-param-remapped-value dashboard (:id parameter) 1)))))))))))))))-(deftest ^:sequential dashboard-remapping-restricted-permissions-test+(deftest ^:synchronized dashboard-remapping-restricted-permissions-test;; Test for issue #47951: Dashboard filters should show remapped values even when;; user has view-data but not create-queries permissions on the target table.(testing "Dashboard parameter remapping"@@ -187,7 +187,7 @@(parameters.dashboard/dashboard-param-remapped-value dashboard (:id parameter) 1))"Querying fails due to insufficient permissions")))))))))))))))-(deftest ^:sequential dashboard-remapping-parallel-fks-test+(deftest ^:synchronized dashboard-remapping-parallel-fks-test(testing "two FKs to the same table, same remap, but pointing to different rows (#65838)"(testing "always shows parameter values using the correct FK";; Before this bug was fixed, the logic chose a parallel edge at random, so one of the two parameter bindings@@ -228,7 +228,7 @@(keys expected))](is (= expected actual))))))))))))))-(deftest ^:sequential dashboard-remapping-conflict-scenarios-test+(deftest ^:synchronized dashboard-remapping-conflict-scenarios-test;; Test various scenarios where FK1, FK2, and PK have different remapping configurations.;; This tests the logic in find-common-remapping-target and documents that it was;; by design.@@ -341,7 +341,7 @@(#'parameters.dashboard/find-common-remapping-target [orders-product-id-field-id]))"Should return target for single FK with remapping")))))))-(deftest ^:sequential field-values-without-create-queries-perms-test+(deftest ^:synchronized field-values-without-create-queries-perms-test(testing "a user with view-data but no create-queries permissions still gets field-values for a mapped dashboard param (#47097)"(mt/dataset test-data(mt/with-temp [:model/Card {card-id :id} {:dataset_query (lib/query (mt/metadata-provider)@@ -369,7 +369,7 @@(is (= #{["Doohickey"] ["Gadget"] ["Gizmo"] ["Widget"]}(set values)))))))))))-(deftest ^:sequential remapped-param-value-with-model-card-test+(deftest ^:synchronized remapped-param-value-with-model-card-test(testing "remapped id-param values work when the mapped source card is a model (#44231)"(mt/dataset test-data(mt/with-temp [:model/Card {model-id :id} {:type :model@@ -397,7 +397,7 @@(is (= [1 "Rustic Paper Wallet"](parameters.dashboard/dashboard-param-remapped-value dashboard (:id parameter) 1))))))))))))-(deftest ^:sequential implicit-fk-pk-name-remapped-value-single-field-test+(deftest ^:synchronized implicit-fk-pk-name-remapped-value-single-field-test(testing "a single-field id param on an FK column resolves via the implicit fk->pk->name remap"(mt/dataset test-data(let [mp (mt/metadata-provider)diff --git a/test/metabase/pulse/pulse_integration_test.clj b/test/metabase/pulse/pulse_integration_test.cljindex b3b5d06bf8f..8b7bdd2c3d2 100644--- a/test/metabase/pulse/pulse_integration_test.clj+++ b/test/metabase/pulse/pulse_integration_test.clj@@ -867,7 +867,7 @@(testing "The text card should always be present"(is (true? (str/includes? html-body card-text))))))))))))-(deftest ^:sequential xray-dashboards-work-test+(deftest ^:synchronized xray-dashboards-work-test(testing "Dashboards produced by generated by X-Rays should not produce bad results (#38350)";; Disable search index, as the way the database is reset at the end can flake somehow.;; This test has nothing to do with search, so not wasting more time on understanding it.diff --git a/test/metabase/query_processor/middleware/annotate_test.clj b/test/metabase/query_processor/middleware/annotate_test.cljindex d1dcd247281..ef3886c787f 100644--- a/test/metabase/query_processor/middleware/annotate_test.clj+++ b/test/metabase/query_processor/middleware/annotate_test.clj@@ -349,7 +349,7 @@[[""]]):cols))))))-(deftest ^:sequential expected-cols-no-infinite-loop-test+(deftest ^:synchronized expected-cols-no-infinite-loop-test(testing "In case of a lib vs. driver column count mismatch, don't loop infinitely (#66955)"(let [query (lib/query meta/metadata-provider(meta/table-metadata :orders))diff --git a/test/metabase/search/index_health_test.clj b/test/metabase/search/index_health_test.cljindex c21ff111fe4..f1a71cba87a 100644--- a/test/metabase/search/index_health_test.clj+++ b/test/metabase/search/index_health_test.clj@@ -9,7 +9,7 @@(set! *warn-on-reflection* true)-(deftest ^:sequential register-index-check!-migrates-a-legacy-registry-test+(deftest ^:synchronized register-index-check!-migrates-a-legacy-registry-test(testing "a live upgrade migrates the defonce'd registry's former vector value"(let [measures (atom [{:check-name :legacy-measure, :collect (constantly nil)}])checks (atom {})]@@ -60,7 +60,7 @@(testing "health is linear between the warning and critical thresholds"(is (=? {:health 50} (index-health/staleness-result 330 60 600 nil)))))-(deftest ^:sequential run-measure!-test+(deftest ^:synchronized run-measure!-test(let [calls (atom [])live (atom #{})](with-redefs [index-health/live-gauge-series live]@@ -101,7 +101,7 @@:index :interrupted-test:collect #(throw (InterruptedException.))}))))-(deftest ^:sequential inapplicable-measure-does-not-create-series-test+(deftest ^:synchronized inapplicable-measure-does-not-create-series-test(testing "an inapplicable measure does not create a NaN-only series"(let [calls (atom [])](mt/with-dynamic-fn-redefs [analytics/set-gauge! (fn [& args] (swap! calls conj (vec args)))]@@ -110,7 +110,7 @@:collect (constantly nil)}))(is (empty? @calls)))))-(deftest ^:sequential failed-first-write-does-not-mark-series-live-test+(deftest ^:synchronized failed-first-write-does-not-mark-series-live-test(testing "a failed first gauge write does not make later clears create a NaN-only series"(let [set-index-gauge! @#'index-health/set-index-gauge!live @#'index-health/live-gauge-series@@ -129,7 +129,7 @@(finally(swap! live disj series))))))-(deftest ^:sequential refresh-isolates-measure-failures-test+(deftest ^:synchronized refresh-isolates-measure-failures-test(testing "one collector failure does not stop later measures from refreshing"(let [calls (atom [])live (atom #{})@@ -153,7 +153,7 @@[:metabase-search/index-coverage-ratio {:index "refresh-isolation-test"} 1.0]]@calls)))))-(deftest ^:sequential pull-collector-refreshes-gauges-on-each-instance-test+(deftest ^:synchronized pull-collector-refreshes-gauges-on-each-instance-test(let [measures @#'index-health/index-measuresrunning? @#'index-health/gauge-refresh-running?before @measures@@ -181,7 +181,7 @@(reset! running? false)(reset! measures before)))))-(deftest ^:sequential background-gauge-refresh-isolates-write-failures-test+(deftest ^:synchronized background-gauge-refresh-isolates-write-failures-test(let [measures (atom {:one {:check-name :one}, :two {:check-name :two}})running? (atom true)seen (atom [])]diff --git a/test/metabase/view_log/events/view_log_test.clj b/test/metabase/view_log/events/view_log_test.cljindex 7bdd2818bf5..12c0cae9c1c 100644--- a/test/metabase/view_log/events/view_log_test.clj+++ b/test/metabase/view_log/events/view_log_test.clj@@ -1,4 +1,4 @@-(ns ^:synchronous metabase.view-log.events.view-log-test+(ns ^:synchronized metabase.view-log.events.view-log-test{:clj-kondo/config '{:linters {:deprecated-var {:exclude {metabase.test.data/mbql-query {:namespaces [metabase.view-log.events.view-log-test]}}}}}}(:require[clojure.test :refer :all]