Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix jepsen timeout #137

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading