Skip to content

Commit cba5d2f

Browse files
committed
Remove --single-mode option
Replaced manually specified option by a function that can detect mode automatically. Closes #36
1 parent 3214905 commit cba5d2f

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ might look like:
4646

4747
```
4848
lein run test --username root --nodes-file nodes --version 2.5 --time-limit 600 --test-count 10
49-
lein run test --nodes-file node --single-mode --engine vinyl --concurrency 20 --time-limit 100
49+
lein run test --nodes-file node --engine vinyl --concurrency 20 --time-limit 100
5050
```
5151

5252
To focus on a particular set of faults, use `--nemesis`

src/tarantool/db.clj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@
196196
(let [p (jepsen/primary test)]
197197
(if (= node p) true false)))
198198

199+
(defn is-single-mode?
200+
[test]
201+
(let [n (count (:nodes test))]
202+
(cond
203+
(= n 1) true
204+
:else false)))
205+
199206
(defn configure!
200207
"Configure instance"
201208
[test node]
@@ -207,7 +214,7 @@
207214
(c/exec :echo (-> "tarantool/jepsen.lua" io/resource slurp
208215
(str/replace #"%TARANTOOL_REPLICATION%" (replica-set test))
209216
(str/replace #"%TARANTOOL_IS_READ_ONLY%" (boolean-to-str read-only))
210-
(str/replace #"%TARANTOOL_SINGLE_MODE%" (boolean-to-str (:single-mode test)))
217+
(str/replace #"%TARANTOOL_SINGLE_MODE%" (boolean-to-str (is-single-mode? test)))
211218
(str/replace #"%TARANTOOL_DATA_ENGINE%" (:engine test)))
212219
:> "/etc/tarantool/instances.enabled/jepsen.lua")
213220
(c/exec :cp "/etc/tarantool/instances.enabled/jepsen.lua" "/etc/tarantool/instances.available")))

src/tarantool/runner.clj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@
7373
:parse-fn keyword
7474
:missing (str "--workload " (cli/one-of workloads))
7575
:validate [workloads (cli/one-of workloads)]]
76-
[nil "--single-mode"
77-
"Use a single Tarantool instance"
78-
:default false]
7976
["-e" "--engine NAME"
8077
"What Tarantool data engine should we use?"
8178
:default "memtx"]])
@@ -134,7 +131,6 @@
134131
:os ubuntu/os
135132
:db (db/db (:version opts))
136133
:engine (:engine opts)
137-
:single-mode (:single-mode opts)
138134
:pure-generators true
139135
:generator gen
140136
:checker (checker/compose {:perf (checker/perf)

0 commit comments

Comments
 (0)