Skip to content

Commit

Permalink
Revert "cockroachdb: bump jepsen version to 0.1.19"
Browse files Browse the repository at this point in the history
This reverts commit f89b518.

We revert bumping jepsen's version as we want to use the code in
`tc-nightly-main` on cockroachdb's master (specifically, we want to be
able to include the environment variable added in #34). The version
bump is not ready yet and causes a number of roachtests to fail.
  • Loading branch information
renatolabs committed Mar 29, 2023
1 parent 47310b2 commit 25ee9a3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions cockroachdb/project.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(defproject cockroachdb "0.2.0"
(defproject cockroachdb "0.1.0"
:description "Jepsen testing for CockroachDB"
:url "http://cockroachlabs.com/"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[jepsen "0.1.19"]
[org.clojure/java.jdbc "0.7.12"]
[org.postgresql/postgresql "42.1.3"]]
:dependencies [[org.clojure/clojure "1.8.0"]
[jepsen "0.1.9-SNAPSHOT"]
[org.clojure/java.jdbc "0.6.1"]
[org.postgresql/postgresql "9.4.1211"]]
:jvm-opts ["-Xmx12g"
"-XX:+UseConcMarkSweepGC"
"-XX:+UseParNewGC"
Expand Down
4 changes: 2 additions & 2 deletions cockroachdb/src/jepsen/cockroach/adya.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[generator :as gen]
[independent :as independent]
[util :as util :refer [meh letr]]
[reconnect :as rc]]
[jepsen.tests.adya :as adya]
[reconnect :as rc]
[adya :as adya]]
[jepsen.checker.timeline :as timeline]
[jepsen.cockroach.client :as c]
[jepsen.cockroach.nemesis :as cln]
Expand Down
24 changes: 10 additions & 14 deletions cockroachdb/src/jepsen/cockroach/bank.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns jepsen.cockroach.bank
"Simulates transfers between bank accounts"
(:refer-clojure :exclude [test])
(:require [jepsen
[cockroach :as cockroach]
(:require [jepsen [cockroach :as cockroach]
[client :as client]
[checker :as checker]
[generator :as gen]
Expand All @@ -15,6 +14,7 @@
[clojure.core.reducers :as r]
[clojure.java.jdbc :as j]
[clojure.tools.logging :refer :all]
[knossos.model :as model]
[knossos.op :as op]))

(defrecord BankClient [tbl-created? n starting-balance conn]
Expand Down Expand Up @@ -113,24 +113,22 @@
"Balances must all be non-negative and sum to the model's total."
[]
(reify checker/Checker
(check [this test history opts]
(let [total (:total test)
n (:n test)
bad-reads (->> history
(check [this test model history opts]
(let [bad-reads (->> history
(r/filter op/ok?)
(r/filter #(= :read (:f %)))
(r/map (fn [op]
(let [balances (:value op)]
(cond (not= n (count balances))
(cond (not= (:n model) (count balances))
{:type :wrong-n
:expected n
:expected (:n model)
:found (count balances)
:op op}

(not= total
(not= (:total model)
(reduce + balances))
{:type :wrong-total
:expected total
:expected (:total model)
:found (reduce + balances)
:op op}

Expand Down Expand Up @@ -163,8 +161,7 @@
[opts]
(bank-test-base
(merge {:name "bank"
:n 5
:total 50
:model {:n 5 :total 50}
:client (BankClient. (atom false) 5 10 nil)}
opts)))

Expand Down Expand Up @@ -247,7 +244,6 @@
[opts]
(bank-test-base
(merge {:name "bank-multitable"
:n 5
:total 50
:model {:n 5 :total 50}
:client (MultiBankClient. (atom false) 5 10 nil)}
opts)))
3 changes: 2 additions & 1 deletion cockroachdb/src/jepsen/cockroach/comments.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
[clojure.core.reducers :as r]
[clojure.set :as set]
[clojure.tools.logging :refer :all]
[knossos.model :as model]
[knossos.op :as op]))

(def table-prefix "String prepended to all table names." "comment_")
Expand Down Expand Up @@ -89,7 +90,7 @@
(defn checker
[]
(reify checker/Checker
(check [this test history opts]
(check [this test model history opts]
; Determine first-order write precedence graph
(let [expected (loop [completed (sorted-set)
expected {}
Expand Down
3 changes: 2 additions & 1 deletion cockroachdb/src/jepsen/cockroach/monotonic.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[clojure.java.jdbc :as j]
[clojure.set :as set]
[clojure.tools.logging :refer :all]
[knossos.model :as model]
[knossos.op :as op]))

(defn parse-row
Expand Down Expand Up @@ -169,7 +170,7 @@
per-process basis."
[linearizable global?]
(reify checker/Checker
(check [this test history opts]
(check [this test model history opts]
(let [add-values (->> history
(r/filter op/ok?)
(r/filter #(= :add (:f %)))
Expand Down
5 changes: 3 additions & 2 deletions cockroachdb/src/jepsen/cockroach/sequential.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
[clojure.core.reducers :as r]
[clojure.set :as set]
[clojure.tools.logging :refer :all]
[knossos.model :as model]
[knossos.op :as op]))

(def table-prefix "String prepended to all table names." "seq_")
Expand Down Expand Up @@ -97,7 +98,7 @@
(c/with-conn [c client]
(c/with-timeout
(doseq [t (table-names table-count)]
(j/execute! c [(str "drop table if exists " t)])))))
(j/execute! c [(str "drop table " t)])))))

(close! [this test]
(rc/close! client)))
Expand Down Expand Up @@ -139,7 +140,7 @@
(defn checker
[]
(reify checker/Checker
(check [this test history opts]
(check [this test model history opts]
(assert (integer? (:key-count test)))
(let [reads (->> history
(r/filter op/ok?)
Expand Down
5 changes: 3 additions & 2 deletions cockroachdb/src/jepsen/cockroach/sets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[clojure.core.reducers :as r]
[clojure.set :as set]
[clojure.tools.logging :refer :all]
[knossos.model :as model]
[knossos.op :as op]))

(defn check-sets
Expand All @@ -23,7 +24,7 @@
elements are unique."
[]
(reify checker/Checker
(check [this test history opts]
(check [this test model history opts]
(let [attempts (->> history
(r/filter op/invoke?)
(r/filter #(= :add (:f %)))
Expand Down Expand Up @@ -124,7 +125,7 @@
(teardown! [this test]
(c/with-timeout
(c/with-conn [c conn]
(j/execute! c ["drop table if exists set"]))))
(j/execute! c ["drop table set"]))))

(close! [this test]
(rc/close! conn)))
Expand Down

0 comments on commit 25ee9a3

Please sign in to comment.