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

Use ScalarDB SNAPSHOT versions in ScalarDB Jepsen test #109

Merged
merged 1 commit into from
Aug 4, 2023
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
3 changes: 2 additions & 1 deletion scalardb/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
[cassandra "0.1.0-SNAPSHOT"]
[cc.qbits/alia "4.3.6"]
[cc.qbits/hayt "4.1.0"]]
:repositories {"sonartype" "https://oss.sonatype.org/content/repositories/snapshots/"}
:profiles {:dev {:dependencies [[tortue/spy "2.0.0"]]
:plugins [[lein-cloverage "1.1.2"]]}
:use-released {:dependencies [[com.scalar-labs/scalardb "3.7.0"
:use-released {:dependencies [[com.scalar-labs/scalardb "4.0.0-SNAPSHOT"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a comment for the user-jars.
Do you think you want to keep use-jars?
I feel we can delete it since it's bothersome to maintain the packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Let's delete it in another PR. Thanks.

;; avoid the netty dependency issue
:exclusions [software.amazon.awssdk/*
com.oracle.database.jdbc/ojdbc8-production
Expand Down
12 changes: 6 additions & 6 deletions scalardb/test/scalardb/elle_append_2pc_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
(reify
TwoPhaseCommitTransaction
(getId [_] "dummy-id")
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void prepare [_] (throw (PreparationException. "preparation failed")))
(^void validate [_] (throw (ValidationException. "validation failed")))
(^void commit [_] (throw (CommitException. "commit failed")))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make this change because the constructors of these exceptions have been changed.

(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void prepare [_] (throw (PreparationException. "preparation failed" nil)))
(^void validate [_] (throw (ValidationException. "validation failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(def mock-2pc-throws-unknown
Expand All @@ -84,7 +84,7 @@
(^void put [_ ^Put p] (mock-put p))
(^void prepare [_] (swap! prepare-count inc))
(^void validate [_] (swap! validate-count inc))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(deftest append-client-init-test
Expand Down
8 changes: 4 additions & 4 deletions scalardb/test/scalardb/elle_append_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@
(def mock-transaction-throws-exception
(reify
DistributedTransaction
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void commit [_] (throw (CommitException. "commit failed")))))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))))

(def mock-transaction-throws-unknown
(reify
DistributedTransaction
(getId [_] "unknown-state-tx")
(^Optional get [_ ^Get g] (mock-get g))
(^void put [_ ^Put p] (mock-put p))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))))

(deftest append-client-init-test
(with-redefs [scalar/setup-transaction-tables (spy/spy)
Expand Down
12 changes: 6 additions & 6 deletions scalardb/test/scalardb/elle_write_read_2pc_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
(reify
TwoPhaseCommitTransaction
(getId [_] "dummy-id")
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void prepare [_] (throw (PreparationException. "preparation failed")))
(^void validate [_] (throw (ValidationException. "validation failed")))
(^void commit [_] (throw (CommitException. "commit failed")))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void prepare [_] (throw (PreparationException. "preparation failed" nil)))
(^void validate [_] (throw (ValidationException. "validation failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(def mock-2pc-throws-unknown
Expand All @@ -84,7 +84,7 @@
(^void put [_ ^Put p] (mock-put p))
(^void prepare [_] (swap! prepare-count inc))
(^void validate [_] (swap! validate-count inc))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(deftest write-read-client-init-test
Expand Down
8 changes: 4 additions & 4 deletions scalardb/test/scalardb/elle_write_read_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@
(def mock-transaction-throws-exception
(reify
DistributedTransaction
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void commit [_] (throw (CommitException. "commit failed")))))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))))

(def mock-transaction-throws-unknown
(reify
DistributedTransaction
(getId [_] "unknown-state-tx")
(^Optional get [_ ^Get g] (mock-get g))
(^void put [_ ^Put p] (mock-put p))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))))

(deftest write-read-client-init-test
(with-redefs [scalar/setup-transaction-tables (spy/spy)
Expand Down
18 changes: 9 additions & 9 deletions scalardb/test/scalardb/transfer_2pc_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
(def mock-transaction-throws-exception
(reify
DistributedTransaction
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void commit [_] (throw (CommitException. "commit failed")))))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))))

(def mock-2pc
(reify
Expand All @@ -90,11 +90,11 @@
(reify
TwoPhaseCommitTransaction
(getId [_] "dummy-id")
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void prepare [_] (throw (PreparationException. "preparation failed")))
(^void validate [_] (throw (ValidationException. "validation failed")))
(^void commit [_] (throw (CommitException. "commit failed")))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void prepare [_] (throw (PreparationException. "preparation failed" nil)))
(^void validate [_] (throw (ValidationException. "validation failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(def mock-2pc-throws-unknown
Expand All @@ -105,7 +105,7 @@
(^void put [_ ^Put p] (mock-put p))
(^void prepare [_] (swap! prepare-count inc))
(^void validate [_] (swap! validate-count inc))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(deftest transfer-client-init-test
Expand Down
18 changes: 9 additions & 9 deletions scalardb/test/scalardb/transfer_append_2pc_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
(def mock-transaction-throws-exception
(reify
DistributedTransaction
(^java.util.List scan [_ ^Scan _] (throw (CrudException. "scan failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void commit [_] (throw (CommitException. "commit failed")))))
(^java.util.List scan [_ ^Scan _] (throw (CrudException. "scan failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))))

(def mock-2pc
(reify
Expand All @@ -93,11 +93,11 @@
(reify
TwoPhaseCommitTransaction
(getId [_] "dummy-id")
(^java.util.List scan [_ ^Scan _] (throw (CrudException. "scan failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void prepare [_] (throw (PreparationException. "preparation failed")))
(^void validate [_] (throw (ValidationException. "validation failed")))
(^void commit [_] (throw (CommitException. "commit failed")))
(^java.util.List scan [_ ^Scan _] (throw (CrudException. "scan failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void prepare [_] (throw (PreparationException. "preparation failed" nil)))
(^void validate [_] (throw (ValidationException. "validation failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(def mock-2pc-throws-unknown
Expand All @@ -108,7 +108,7 @@
(^void put [_ ^Put p] (mock-put p))
(^void prepare [_] (swap! prepare-count inc))
(^void validate [_] (swap! validate-count inc))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))
(^void rollback [_] (swap! rollback-count inc))))

(deftest transfer-client-init-test
Expand Down
8 changes: 4 additions & 4 deletions scalardb/test/scalardb/transfer_append_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
(def mock-transaction-throws-exception
(reify
DistributedTransaction
(^java.util.List scan [_ ^Scan _] (throw (CrudException. "scan failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void commit [_] (throw (CommitException. "commit failed")))))
(^java.util.List scan [_ ^Scan _] (throw (CrudException. "scan failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))))

(def mock-transaction-throws-unknown
(reify
DistributedTransaction
(getId [_] "unknown-state-tx")
(^java.util.List scan [_ ^Scan s] (mock-scan s))
(^void put [_ ^Put p] (mock-put p))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))))

(deftest transfer-client-init-test
(binding [test-records (atom {})
Expand Down
8 changes: 4 additions & 4 deletions scalardb/test/scalardb/transfer_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@
(def mock-transaction-throws-exception
(reify
DistributedTransaction
(^Optional get [_ ^Get _] (throw (CrudException. "get failed")))
(^void put [_ ^Put _] (throw (CrudException. "put failed")))
(^void commit [_] (throw (CommitException. "commit failed")))))
(^Optional get [_ ^Get _] (throw (CrudException. "get failed" nil)))
(^void put [_ ^Put _] (throw (CrudException. "put failed" nil)))
(^void commit [_] (throw (CommitException. "commit failed" nil)))))

(def mock-transaction-throws-unknown
(reify
DistributedTransaction
(getId [_] "unknown-state-tx")
(^Optional get [_ ^Get g] (mock-get g))
(^void put [_ ^Put p] (mock-put p))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state")))))
(^void commit [_] (throw (UnknownTransactionStatusException. "unknown state" nil)))))

(deftest transfer-client-init-test
(binding [test-records (atom {0 0 1 0 2 0 3 0 4 0})
Expand Down
Loading