summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/distributor
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2023-08-21 13:37:14 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2023-08-21 13:37:14 +0000
commitb045c3f2fa147e1c551bc46a8266afe3204fa788 (patch)
tree9dbe633a0cca8c78972e86f7acf8ec68f76656de /storage/src/tests/distributor
parent0f9f11da84db6a2ec1190758c3e60d6861c23438 (diff)
Make partial cancellelation state part of the API
Also rename factory function to avoid explicit coupling to higher level semantics.
Diffstat (limited to 'storage/src/tests/distributor')
-rw-r--r--storage/src/tests/distributor/check_condition_test.cpp2
-rw-r--r--storage/src/tests/distributor/garbagecollectiontest.cpp4
-rw-r--r--storage/src/tests/distributor/putoperationtest.cpp8
-rw-r--r--storage/src/tests/distributor/removeoperationtest.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/storage/src/tests/distributor/check_condition_test.cpp b/storage/src/tests/distributor/check_condition_test.cpp
index 92c3b120da2..617401dd271 100644
--- a/storage/src/tests/distributor/check_condition_test.cpp
+++ b/storage/src/tests/distributor/check_condition_test.cpp
@@ -231,7 +231,7 @@ TEST_F(CheckConditionTest, failed_gets_completes_check_with_error_outcome) {
TEST_F(CheckConditionTest, check_fails_if_condition_explicitly_cancelled) {
test_cond_with_2_gets_sent([&](auto& cond) {
cond.handle_reply(_sender, make_matched_reply(0));
- cond.cancel(_sender, CancelScope::of_ownership_change());
+ cond.cancel(_sender, CancelScope::of_fully_cancelled());
cond.handle_reply(_sender, make_matched_reply(1));
}, [&](auto& outcome) {
EXPECT_FALSE(outcome.matched_condition());
diff --git a/storage/src/tests/distributor/garbagecollectiontest.cpp b/storage/src/tests/distributor/garbagecollectiontest.cpp
index c3cec32b279..b1cf1cbc636 100644
--- a/storage/src/tests/distributor/garbagecollectiontest.cpp
+++ b/storage/src/tests/distributor/garbagecollectiontest.cpp
@@ -177,7 +177,7 @@ TEST_F(GarbageCollectionOperationTest, no_replica_bucket_info_added_to_db_if_ope
ASSERT_EQ(2, _sender.commands().size());
reply_to_nth_request(*op, 0, 1234, 70);
- op->cancel(_sender, CancelScope::of_ownership_change());
+ op->cancel(_sender, CancelScope::of_fully_cancelled());
reply_to_nth_request(*op, 1, 4567, 60);
// DB state is unchanged. Note that in a real scenario, the DB entry will have been removed
@@ -408,7 +408,7 @@ TEST_F(GarbageCollectionOperationPhase1FailureTest, no_second_phase_if_bucket_in
}
TEST_F(GarbageCollectionOperationPhase1FailureTest, no_second_phase_if_operation_fully_cancelled_between_phases) {
- _op->cancel(_sender, CancelScope::of_ownership_change());
+ _op->cancel(_sender, CancelScope::of_fully_cancelled());
receive_phase1_replies_and_assert_no_phase_2_started();
}
diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp
index 431b7595571..ee87fe84df6 100644
--- a/storage/src/tests/distributor/putoperationtest.cpp
+++ b/storage/src/tests/distributor/putoperationtest.cpp
@@ -217,7 +217,7 @@ TEST_F(PutOperationTest, failed_CreateBucket_does_not_send_RequestBucketInfo_if_
ASSERT_EQ("Create bucket => 1,Create bucket => 0,Put => 1,Put => 0", _sender.getCommands(true));
- op->cancel(_sender, CancelScope::of_ownership_change());
+ op->cancel(_sender, CancelScope::of_fully_cancelled());
sendReply(0, api::ReturnCode::TIMEOUT, api::BucketInfo()); // CreateBucket to node 1
// DB is not touched (note: normally node 1 would be removed at the cancel-edge).
@@ -320,7 +320,7 @@ TEST_F(PutOperationTest, return_success_if_op_acked_on_all_replicas_even_if_oper
"id:test:testdoctype1::, timestamp 100, size 45) => 1",
_sender.getCommands(true, true));
- op->cancel(_sender, CancelScope::of_ownership_change());
+ op->cancel(_sender, CancelScope::of_fully_cancelled());
sendReply(0);
sendReply(1);
@@ -659,7 +659,7 @@ TEST_F(PutOperationTest, db_not_updated_if_operation_cancelled_by_ownership_chan
ASSERT_EQ("Put => 1,Put => 2,Put => 0", _sender.getCommands(true));
operation_context().remove_nodes_from_bucket_database(makeDocumentBucket(bucket), {0, 1, 2});
- op->cancel(_sender, CancelScope::of_ownership_change());
+ op->cancel(_sender, CancelScope::of_fully_cancelled());
// Normally DB updates triggered by replies don't _create_ buckets in the DB, unless
// they're remapped buckets. Use a remapping to ensure we hit a create-if-missing DB path.
@@ -886,7 +886,7 @@ TEST_F(PutOperationTest, ownership_cancellation_during_condition_probe_fails_ope
ASSERT_NO_FATAL_FAILURE(set_up_tas_put_with_2_inconsistent_replica_nodes());
op->receive(_sender, make_get_reply(*sent_get_command(0), 0, false, false));
- op->cancel(_sender, CancelScope::of_ownership_change());
+ op->cancel(_sender, CancelScope::of_fully_cancelled());
op->receive(_sender, make_get_reply(*sent_get_command(1), 0, false, false));
ASSERT_EQ("Get => 1,Get => 0", _sender.getCommands(true));
diff --git a/storage/src/tests/distributor/removeoperationtest.cpp b/storage/src/tests/distributor/removeoperationtest.cpp
index 762f9857fce..3fad2c194a2 100644
--- a/storage/src/tests/distributor/removeoperationtest.cpp
+++ b/storage/src/tests/distributor/removeoperationtest.cpp
@@ -315,7 +315,7 @@ TEST_F(ExtRemoveOperationTest, cancellation_during_condition_probe_fails_operati
ASSERT_NO_FATAL_FAILURE(set_up_tas_remove_with_2_nodes(ReplicaState::INCONSISTENT));
reply_with(make_get_reply(0, 50, false, true));
- op->cancel(_sender, CancelScope::of_ownership_change());
+ op->cancel(_sender, CancelScope::of_fully_cancelled());
reply_with(make_get_reply(1, 50, false, true));
ASSERT_EQ("Get => 1,Get => 0", _sender.getCommands(true));