diff --git a/test/metabase/async/api_response_test.clj b/test/metabase/async/api_response_test.clj index 0798d4dc26e94a938578a868e9e8ab6eff3b61fb..e0d3f18728cdc69cc43bc6169ff5504f183ed375 100644 --- a/test/metabase/async/api_response_test.clj +++ b/test/metabase/async/api_response_test.clj @@ -186,12 +186,14 @@ (expect (with-redefs [async-response/absolute-max-keepalive-ms 500] (tu.async/with-chans [input-chan] - (with-response [_ input-chan] + (with-response [{:keys [os-closed-chan]} input-chan] + (wait-for-close os-closed-chan) (wait-for-close input-chan))))) ;; output chan should get closed (expect (with-redefs [async-response/absolute-max-keepalive-ms 500] (tu.async/with-chans [input-chan] - (with-response [{:keys [output-chan]} input-chan] + (with-response [{:keys [output-chan os-closed-chan]} input-chan] + (wait-for-close os-closed-chan) (wait-for-close output-chan))))) diff --git a/test/metabase/driver/sql_jdbc/execute_test.clj b/test/metabase/driver/sql_jdbc/execute_test.clj index 97f1d43b1206071500ec9f9ce350ba651316afaf..4fc8723dd28875c0abdd5e2518dd5cc1d05de69d 100644 --- a/test/metabase/driver/sql_jdbc/execute_test.clj +++ b/test/metabase/driver/sql_jdbc/execute_test.clj @@ -7,6 +7,8 @@ (:import java.sql.PreparedStatement)) (defn- do-with-max-rows [f] + ;; force loading of the test data before swapping out `jdbc/query`, otherwise things might not sync correctly + (data/id) (let [orig-query jdbc/query max-rows (atom nil)] (with-redefs [jdbc/query (fn [conn sql-params & [opts]]