File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 190190 :cluster-cassandra :cassandra-scalardb-cluster ))
191191 (catch Exception _))
192192 (try
193- (c/exec :kubectl :delete
194- :pvc :-l " app.kubernetes.io/instance=postgresql-scalardb-cluster" )
193+ (c/exec :kubectl :delete :pvc :-l
194+ (str " app.kubernetes.io/instance="
195+ (case (:db-type test)
196+ :cluster " postgresql-scalardb-cluster"
197+ :cluster-cassandra " cassandra-scalardb-cluster" )))
195198 (catch Exception _))
196199 (try
197200 (c/exec :helm :uninstall :scalardb-cluster )
Original file line number Diff line number Diff line change 1515(def ^:private ^:const PARTITION_YAML " ./partition.yaml" )
1616(def ^:private ^:const PACKET_FAULT_YAML " ./packet-fault.yaml" )
1717
18+ (def ^:private ^:const MAX_FAULT_POD_NUM 3 )
19+
1820(defn- time-fault-yaml
1921 [pod-name]
2022 (str " ./time-fault-" pod-name " .yaml" ))
3739 (if (contains? #{:pause :kill } pod-fault)
3840 (binding [c/*dir* (System/getProperty " user.dir" )]
3941 (let [targets (->> (get-pod-list )
40- ; ; choose envoy or cluster nodes
41- ; (filter #(str/starts-with? % "scalardb-"))
42- ; ; TODO: test failed when killing a postgres pod
43- (filter #(str/starts-with? % " postgresql-" ))
4442 shuffle
45- (take (inc (rand-int 3 ))))
43+ (take (inc (rand-int MAX_FAULT_POD_NUM ))))
4644 action (case pod-fault
4745 :pause " pod-failure"
4846 :kill " pod-kill" )
196194 :start (c/on (-> test :nodes first)
197195 (let [grudge (->> (get-pod-list )
198196 shuffle
199- (take (inc (rand-int 3 ))))]
197+ (take (inc (rand-int MAX_FAULT_POD_NUM ))))]
200198 (apply-partition-exp grudge)
201199 (assoc op :value [:isolated grudge])))
202200 :stop (do (c/on (-> test :nodes first) (delete-partition-exp ))
274272 (->> (c/on (-> test :nodes first)
275273 (get-cluster-node-pods ))
276274 shuffle
277- (take (inc (rand-int 3 )))))
275+ (take (inc (rand-int MAX_FAULT_POD_NUM )))))
278276 clock-gen (gen/mix [(nt/reset-gen-select target-select)
279277 (nt/bump-gen-select target-select)])
280278 gen (->> clock-gen
You can’t perform that action at this time.
0 commit comments