From 363d7f9a2d96119ab036242ac6e9b53137c9c1ac Mon Sep 17 00:00:00 2001 From: Toshihiro Suzuki Date: Mon, 31 Jul 2023 16:32:20 +0900 Subject: [PATCH] Use ScalarDB SNAPSHOT versions in ScalarDB Jepsen test --- scalardb/project.clj | 3 ++- .../test/scalardb/elle_append_2pc_test.clj | 12 ++++++------ scalardb/test/scalardb/elle_append_test.clj | 8 ++++---- .../test/scalardb/elle_write_read_2pc_test.clj | 12 ++++++------ .../test/scalardb/elle_write_read_test.clj | 8 ++++---- scalardb/test/scalardb/transfer_2pc_test.clj | 18 +++++++++--------- .../test/scalardb/transfer_append_2pc_test.clj | 18 +++++++++--------- .../test/scalardb/transfer_append_test.clj | 8 ++++---- scalardb/test/scalardb/transfer_test.clj | 8 ++++---- 9 files changed, 48 insertions(+), 47 deletions(-) diff --git a/scalardb/project.clj b/scalardb/project.clj index 4d04f94..d362721 100644 --- a/scalardb/project.clj +++ b/scalardb/project.clj @@ -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" ;; avoid the netty dependency issue :exclusions [software.amazon.awssdk/* com.oracle.database.jdbc/ojdbc8-production diff --git a/scalardb/test/scalardb/elle_append_2pc_test.clj b/scalardb/test/scalardb/elle_append_2pc_test.clj index e88780c..8f610d5 100644 --- a/scalardb/test/scalardb/elle_append_2pc_test.clj +++ b/scalardb/test/scalardb/elle_append_2pc_test.clj @@ -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 @@ -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 diff --git a/scalardb/test/scalardb/elle_append_test.clj b/scalardb/test/scalardb/elle_append_test.clj index ffb6e0f..9c76e5d 100644 --- a/scalardb/test/scalardb/elle_append_test.clj +++ b/scalardb/test/scalardb/elle_append_test.clj @@ -59,9 +59,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-transaction-throws-unknown (reify @@ -69,7 +69,7 @@ (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) diff --git a/scalardb/test/scalardb/elle_write_read_2pc_test.clj b/scalardb/test/scalardb/elle_write_read_2pc_test.clj index 8603c38..0ece448 100644 --- a/scalardb/test/scalardb/elle_write_read_2pc_test.clj +++ b/scalardb/test/scalardb/elle_write_read_2pc_test.clj @@ -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 @@ -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 diff --git a/scalardb/test/scalardb/elle_write_read_test.clj b/scalardb/test/scalardb/elle_write_read_test.clj index a0e32ac..c3c43cf 100644 --- a/scalardb/test/scalardb/elle_write_read_test.clj +++ b/scalardb/test/scalardb/elle_write_read_test.clj @@ -59,9 +59,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-transaction-throws-unknown (reify @@ -69,7 +69,7 @@ (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) diff --git a/scalardb/test/scalardb/transfer_2pc_test.clj b/scalardb/test/scalardb/transfer_2pc_test.clj index b32e734..493368b 100644 --- a/scalardb/test/scalardb/transfer_2pc_test.clj +++ b/scalardb/test/scalardb/transfer_2pc_test.clj @@ -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 @@ -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 @@ -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 diff --git a/scalardb/test/scalardb/transfer_append_2pc_test.clj b/scalardb/test/scalardb/transfer_append_2pc_test.clj index b51a2f8..c91ab6f 100644 --- a/scalardb/test/scalardb/transfer_append_2pc_test.clj +++ b/scalardb/test/scalardb/transfer_append_2pc_test.clj @@ -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 @@ -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 @@ -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 diff --git a/scalardb/test/scalardb/transfer_append_test.clj b/scalardb/test/scalardb/transfer_append_test.clj index fcc433b..46e398c 100644 --- a/scalardb/test/scalardb/transfer_append_test.clj +++ b/scalardb/test/scalardb/transfer_append_test.clj @@ -68,9 +68,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-transaction-throws-unknown (reify @@ -78,7 +78,7 @@ (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 {}) diff --git a/scalardb/test/scalardb/transfer_test.clj b/scalardb/test/scalardb/transfer_test.clj index 16fe3fd..df4b7d2 100644 --- a/scalardb/test/scalardb/transfer_test.clj +++ b/scalardb/test/scalardb/transfer_test.clj @@ -65,9 +65,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-transaction-throws-unknown (reify @@ -75,7 +75,7 @@ (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})