diff options
author | Alex Auvolat <alex@adnab.me> | 2023-10-24 11:39:45 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-10-24 11:39:45 +0200 |
commit | d2c365767b0a4cb70dcbb1d20b75f41e0f9c20c8 (patch) | |
tree | 04be8d159078a42304bc19a20ac6ac5f206a657b /script/jepsen.garage/src/jepsen/garage/nemesis.clj | |
parent | fb6c9a1243bd561d2a0de6b49c8debf37d566473 (diff) | |
download | garage-d2c365767b0a4cb70dcbb1d20b75f41e0f9c20c8.tar.gz garage-d2c365767b0a4cb70dcbb1d20b75f41e0f9c20c8.zip |
jepsen: more testing
Diffstat (limited to 'script/jepsen.garage/src/jepsen/garage/nemesis.clj')
-rw-r--r-- | script/jepsen.garage/src/jepsen/garage/nemesis.clj | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/script/jepsen.garage/src/jepsen/garage/nemesis.clj b/script/jepsen.garage/src/jepsen/garage/nemesis.clj index 9edfe418..e64bcaf1 100644 --- a/script/jepsen.garage/src/jepsen/garage/nemesis.clj +++ b/script/jepsen.garage/src/jepsen/garage/nemesis.clj @@ -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)})}) |