From 4c1b2223a90f834d49028b6de3bc9659e36a3080 Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Wed, 2 Oct 2024 17:40:23 +0300 Subject: [PATCH] fix jepsen timeout --- .../jepsen_main/jepsen/src/jepsen/mysync.clj | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj b/tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj index 4b13d47..af15330 100644 --- a/tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj +++ b/tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj @@ -91,21 +91,21 @@ (invoke! [this test op] (try - (timeout 5000 (assoc op :type :info, :error "timeout") - (with-conn [c conn] - (case (:f op) - :read (cond (= (count (j/query c ["show slave status for channel ''"])) 0) - (assoc op :type :ok, - :value (->> (j/query c ["select value from test1.test_set"] - {:row-fn :value}) - (vec) - (set))) - true - (assoc op :type :info, :error "read-only")) - :add (do - (info (str "Adding: " (get op :value) " to " (get c :subname))) - (j/execute! c [(str "insert into test1.test_set values ('" (get op :value) "')")]) - (assoc op :type :ok))))) + (with-conn [c conn] + (case (:f op) + :read (cond (= (count (j/query c ["show slave status for channel ''"])) 0) + (assoc op :type :ok, + :value (->> (j/query c ["select value from test1.test_set"] + {:row-fn :value}) + (vec) + (set))) + true + (assoc op :type :info, :error "read-only")) + :add (timeout 5000 (assoc op :type :info, :error "timeout") + (do + (info (str "Adding: " (get op :value) " to " (get c :subname))) + (j/execute! c [(str "insert into test1.test_set values ('" (get op :value) "')")]) + (assoc op :type :ok))))) (catch Throwable t# (let [m# (.getMessage t#)] (cond