Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix long fork checker #78

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ change log follows the conventions of
### Fixed

- A `set` checker (#44).
- A `long-fork` checker (#43).

### Changed

Expand Down
4 changes: 4 additions & 0 deletions histories/jepsen/long-fork.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[{:type :invoke, :f :read, :value [[:r 0 nil] [:r 1 nil] [:r 2 nil]]},
{:type :ok, :f :read, :value [[:r 0 1] [:r 1 1] [:r 2 nil]]},
{:type :invoke, :f :read, :value [[:r 2 nil] [:r 0 nil] [:r 1 nil]]},
{:type :ok, :f :read, :value [[:r 2 1] [:r 0 1] [:r 1 nil]]}]
13 changes: 5 additions & 8 deletions src/elle_cli/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@
:parse-fn #(Integer/parseInt %)]

; Jepsen-specific options.
; None.
["-g" "--group-size GROUP-SIZE"
"(Jepsen) A group size."
:default 0
:parse-fn #(Integer/parseInt %)]

; Knossos-specific options.
; None.
Expand Down Expand Up @@ -177,21 +180,15 @@
; see src/knossos/cli.clj:read-history.
"cas-register" (competition/analysis (checker-fn) (history/parse-ops history))
"mutex" (competition/analysis (checker-fn) (history/parse-ops history))
"knossos-cas-register" (competition/analysis (checker-fn) (history/parse-ops history))
"knossos-mutex" (competition/analysis (checker-fn) (history/parse-ops history))
"comments" ((independent/checker (checker-fn)) (history/parse-ops history))
"sequential" ((checker-fn) (history/parse-ops history))
"list-append" (checker-fn options history)
"rw-register" (checker-fn options history)
"elle-list-append" (checker-fn options history)
"elle-rw-register" (checker-fn options history)
"bank" (jepsen-model/check-safe (checker-fn {:negative-balances? true}) nil history)
"counter" (jepsen-model/check-safe (checker-fn) nil history)
"set" (jepsen-model/check-safe (checker-fn) nil history)
"set-full" (jepsen-model/check-safe (checker-fn) nil history)
"jepsen-bank" (jepsen-model/check-safe (checker-fn {:negative-balances? true}) nil history)
"jepsen-counter" (jepsen-model/check-safe (checker-fn) nil history)
"jepsen-set-full" (jepsen-model/check-safe (checker-fn) nil history))))
"long-fork" (jepsen-model/check-safe (checker-fn (get options :group-size)) nil history))))

(defn read-fn-by-extension
"Take a path to file and returns a function for reading that file."
Expand Down
1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ run_test 1 "--model bank histories/jepsen/bank.edn"
run_test 1 "--model bank histories/jepsen/bank.json"
run_test 1 "--model bank histories/jepsen/bank-tidb.edn"

run_test 1 "--model long-fork --group-size 3 histories/jepsen/long-fork.edn"

exit $suite_status
Loading