set tests with independant tests together

This commit is contained in:
Alex Auvolat 2023-04-19 16:16:34 +02:00
parent 0bb1577ae1
commit 55eb4e87c4
2 changed files with 42 additions and 20 deletions

View file

@ -24,6 +24,13 @@ Run tests (this one should fail):
lein run test --nodes-file nodes.vagrant --time-limit 64 --concurrency 50 --rate 50 --workload reg lein run test --nodes-file nodes.vagrant --time-limit 64 --concurrency 50 --rate 50 --workload reg
``` ```
These ones are working:
```
lein run test --nodes-file nodes.vagrant --time-limit 64 --rate 50 --concurrency 50 --workload set1
lein run test --nodes-file nodes.vagrant --time-limit 64 --rate 50 --concurrency 50 --workload set2
```
## License ## License
Copyright © 2023 Alex Auvolat Copyright © 2023 Alex Auvolat

View file

@ -28,14 +28,18 @@
(assoc this :creds creds))) (assoc this :creds creds)))
(setup! [this test]) (setup! [this test])
(invoke! [this test op] (invoke! [this test op]
(case (:f op) (let [[k v] (:value op)
:add prefix (str "set" k "/")]
(do (case (:f op)
(grg/s3-put (:creds this) (str (:value op)) "present") :add
(assoc op :type :ok)) (do
:read (grg/s3-put (:creds this) (str prefix v) "present")
(let [items (grg/s3-list (:creds this) "")] (assoc op :type :ok))
(assoc op :type :ok, :value (set (map read-string items)))))) :read
(let [items (grg/s3-list (:creds this) prefix)
items-stripped (map (fn [o] (str/replace-first o prefix "")) items)
items-set (set (map read-string items-stripped))]
(assoc op :type :ok, :value (independent/tuple k items-set))))))
(teardown! [this test]) (teardown! [this test])
(close! [this test])) (close! [this test]))
@ -43,22 +47,33 @@
"Tests insertions and deletions" "Tests insertions and deletions"
[opts] [opts]
{:client (SetClient. nil) {:client (SetClient. nil)
:checker (checker/compose :checker (independent/checker
{:set (checker/set) (checker/compose
:timeline (timeline/html)}) {:set (checker/set)
; :generator (gen/mix [op-add op-read]) :timeline (timeline/html)}))
:generator (->> (range) :generator (independent/concurrent-generator
(map (fn [x] {:type :invoke, :f :add, :value x}))) 10
:final-generator (gen/once op-read)}) (range 100)
(fn [k]
(->>
(gen/mix [op-add])
(gen/limit (:ops-per-key opts)))))
:final-generator (independent/sequential-generator
(range 100)
(fn [k] (gen/once op-read)))})
(defn workload2 (defn workload2
"Tests insertions and deletions" "Tests insertions and deletions"
[opts] [opts]
{:client (SetClient. nil) {:client (SetClient. nil)
:checker (checker/compose :checker (independent/checker
{:set (checker/set-full {:linearizable? false}) (checker/compose
:timeline (timeline/html)}) {:set (checker/set-full {:linearizable? false})
:generator (gen/mix [op-read :timeline (timeline/html)}))
(->> (range) (map (fn [x] {:type :invoke, :f :add, :value x})))])}) :generator (independent/concurrent-generator
10
(range 100)
(fn [k]
(gen/mix [op-add op-read])))})