Skip to content

Commit

Permalink
Mongo: add key-time-limit option
Browse files Browse the repository at this point in the history
  • Loading branch information
aphyr committed May 10, 2016
1 parent 2a8a72e commit ed8b652
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mongodb/src/jepsen/mongodb/document_cas.clj
Expand Up @@ -110,7 +110,8 @@
:write-concern Keyword for write concern level
:read-concern Keyword for read concern level
:read-with-find-and-modify Use findAndModify to ensure read safety
:time-limit How long do we run the test for?"
:time-limit How long do we run the test for?
:key-time-limit How long do we test an individual key?"
[opts]
(test- (str "doc cas"
" r:" (name (:read-concern opts))
Expand All @@ -126,7 +127,8 @@
(gen/reserve 5 (if (:no-reads opts)
(gen/mix [w cas cas])
r))
(gen/time-limit 30))))
(gen/time-limit
(:key-time-limit opts)))))
std-gen
(gen/time-limit (:time-limit opts)))
:model (model/cas-register)
Expand Down
8 changes: 7 additions & 1 deletion mongodb/src/jepsen/mongodb/runner.clj
Expand Up @@ -23,11 +23,17 @@
[["-h" "--help" "Print out this message and exit"]

["-t" "--time-limit SECONDS"
"Excluding setup and teardown, how long should tests run for?"
"Excluding setup and teardown, how long should tests run for, in seconds?"
:default 150
:parse-fn #(Long/parseLong %)
:validate [pos? "Must be positive"]]

[nil "--key-time-limit SECONDS"
"How long should we test an individual key for, in seconds?"
:default 30
:parse-fn #(Long/parseLong %)
:validate [pos? "Must be positive"]]

["-w" "--write-concern LEVEL" "Write concern level"
:default :majority
:parse-fn keyword
Expand Down

0 comments on commit ed8b652

Please sign in to comment.