mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-25 20:06:53 +00:00
jepsen: more testing
This commit is contained in:
@@ -23,8 +23,10 @@
|
||||
|
||||
(def scenari
|
||||
"A map of scenari to the associated nemesis"
|
||||
{"cp" grgNemesis/scenario-cp
|
||||
"r" grgNemesis/scenario-r})
|
||||
{"c" grgNemesis/scenario-c
|
||||
"cp" grgNemesis/scenario-cp
|
||||
"r" grgNemesis/scenario-r
|
||||
"pr" grgNemesis/scenario-pr})
|
||||
|
||||
(def patches
|
||||
"A map of patch names to Garage builds"
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
[jepsen.garage.daemon :as grg]
|
||||
[jepsen.control.util :as cu]))
|
||||
|
||||
; ---- reconfiguration nemesis ----
|
||||
|
||||
(defn configure-present!
|
||||
"Configure node to be active in new cluster layout"
|
||||
[test node]
|
||||
@@ -61,8 +63,18 @@
|
||||
|
||||
(teardown! [this test] this)))
|
||||
|
||||
; ---- nemesis scenari ----
|
||||
|
||||
(defn scenario-c
|
||||
"Clock scramble scenario"
|
||||
[opts]
|
||||
{:generator (cycle [(gen/sleep 5)
|
||||
{:type :info, :f :clock-scramble}])
|
||||
:nemesis (nemesis/compose
|
||||
{{:clock-scramble :scramble} (nemesis/clock-scrambler 20.0)})})
|
||||
|
||||
(defn scenario-cp
|
||||
"Clock scramble + parittion scenario"
|
||||
"Clock scramble + partition scenario"
|
||||
[opts]
|
||||
{:generator (cycle [(gen/sleep 5)
|
||||
{:type :info, :f :partition-start}
|
||||
@@ -91,3 +103,23 @@
|
||||
:nemesis (nemesis/compose
|
||||
{{:reconfigure-start :start
|
||||
:reconfigure-stop :stop} (reconfigure-subset 3)})})
|
||||
|
||||
(defn scenario-pr
|
||||
"Partition + cluster reconfiguration scenario"
|
||||
[opts]
|
||||
{:generator (cycle [(gen/sleep 3)
|
||||
{:type :info, :f :reconfigure-start}
|
||||
(gen/sleep 3)
|
||||
{:type :info, :f :partition-start}
|
||||
(gen/sleep 3)
|
||||
{:type :info, :f :reconfigure-start}
|
||||
(gen/sleep 3)
|
||||
{:type :info, :f :partition-stop}
|
||||
(gen/sleep 3)
|
||||
{:type :info, :f :reconfigure-stop}])
|
||||
:final-generator (gen/once {:type :info, :f :partition-stop})
|
||||
:nemesis (nemesis/compose
|
||||
{{:partition-start :start
|
||||
:partition-stop :stop} (nemesis/partition-random-halves)
|
||||
{:reconfigure-start :start
|
||||
:reconfigure-stop :stop} (reconfigure-subset 3)})})
|
||||
|
||||
@@ -39,12 +39,10 @@
|
||||
new-object-summaries (:object-summaries list-result)
|
||||
new-objects (map (fn [d] (:key d)) new-object-summaries)
|
||||
objects (concat new-objects accum)]
|
||||
(info (:endpoint creds) "ListObjectsV2 prefix(" prefix "), ct(" ct "): " new-objects)
|
||||
(if (:truncated? list-result)
|
||||
(list-inner creds prefix (:next-continuation-token list-result) objects)
|
||||
objects)))
|
||||
(defn list
|
||||
"Helper for ListObjects -- just lists everything in the bucket"
|
||||
[creds prefix]
|
||||
(info "in s3/list creds:" creds ", prefix:" prefix)
|
||||
(list-inner creds prefix nil []))
|
||||
|
||||
@@ -45,9 +45,7 @@
|
||||
10000
|
||||
(assoc op :type :fail, :error ::timeout)
|
||||
(do
|
||||
(info "call s3/list creds: " (:creds this) ", prefix:" prefix)
|
||||
(let [items (s3/list (:creds this) prefix)]
|
||||
(info "list results for prefix" prefix ":" items " (node:" (:endpoint (:creds this)) ")")
|
||||
(let [items-stripped (map (fn [o]
|
||||
(assert (str/starts-with? o prefix))
|
||||
(str/replace-first o prefix "")) items)
|
||||
@@ -115,8 +113,8 @@
|
||||
{:client (SetClient. nil)
|
||||
:checker (independent/checker
|
||||
(checker/compose
|
||||
{:set-full (checker/set-full {:linearizable? false})
|
||||
:set-read-after-write (set-read-after-write)
|
||||
{:set-read-after-write (set-read-after-write)
|
||||
; :set-full (checker/set-full {:linearizable? false})
|
||||
:timeline (timeline/html)}))
|
||||
:generator (independent/concurrent-generator
|
||||
10
|
||||
|
||||
Reference in New Issue
Block a user