aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgvit <gvit@ydb.tech>2022-11-05 19:45:54 +0300
committergvit <gvit@ydb.tech>2022-11-05 19:45:54 +0300
commit2c9d96a45fc20372f08fbab8a952ece73b406594 (patch)
tree62b595d4409065fa0c67b29659ff536e84add6ef
parentb4c42e1b5b8489e6081121eda096d2d93f25c49b (diff)
downloadydb-2c9d96a45fc20372f08fbab8a952ece73b406594.tar.gz
continue switching datashard tests to public api
-rw-r--r--ydb/core/tx/datashard/datashard_ut_order.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/ydb/core/tx/datashard/datashard_ut_order.cpp b/ydb/core/tx/datashard/datashard_ut_order.cpp
index 5185737b8fd..0b50c6e6b20 100644
--- a/ydb/core/tx/datashard/datashard_ut_order.cpp
+++ b/ydb/core/tx/datashard/datashard_ut_order.cpp
@@ -4345,30 +4345,25 @@ Y_UNIT_TEST(TestSnapshotReadAfterBrokenLock) {
// Perform an additional read, it would mark transaction as write-broken
{
- auto ev = ExecRequest(runtime, sender, MakeContinueRequest(sessionId, txId, Q_(R"(
+ auto result = KqpSimpleContinue(runtime, sessionId, txId, Q_(R"(
SELECT * FROM `/Root/table-1` WHERE key = 3
- )")));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS);
- UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u);
+ )"));
+ UNIT_ASSERT_VALUES_EQUAL(result, "");
}
// Perform one more read, it would be in an already write-broken transaction
{
- auto ev = ExecRequest(runtime, sender, MakeContinueRequest(sessionId, txId, Q_(R"(
+ auto result = KqpSimpleContinue(runtime, sessionId, txId, Q_(R"(
SELECT * FROM `/Root/table-1` WHERE key = 5
- )")));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS);
- UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u);
+ )"));
+ UNIT_ASSERT_VALUES_EQUAL(result, "");
}
{
- auto ev = ExecRequest(runtime, sender, MakeCommitRequest(sessionId, txId, Q_(R"(
+ auto result = KqpSimpleCommit(runtime, sessionId, txId, Q_(R"(
UPSERT INTO `/Root/table-1` (key, value) VALUES (5, 5)
- )")));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::ABORTED);
+ )"));
+ UNIT_ASSERT_VALUES_EQUAL(result, "ERROR: ABORTED");
}
}
@@ -4471,32 +4466,27 @@ Y_UNIT_TEST(TestSnapshotReadAfterBrokenLockOutOfOrder) {
// Perform an additional read, it would mark transaction as write-broken for the first time
{
Cerr << "... performing the second select" << Endl;
- auto ev = ExecRequest(runtime, sender, MakeContinueRequest(sessionId, txId, Q_(R"(
+ auto result = KqpSimpleContinue(runtime, sessionId, txId, Q_(R"(
SELECT * FROM `/Root/table-1` WHERE key = 3
- )")));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS);
- UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u);
+ )"));
+ UNIT_ASSERT_VALUES_EQUAL(result, "");
}
// Perform one more read, it would be in an already write-broken transaction
{
Cerr << "... performing the third select" << Endl;
- auto ev = ExecRequest(runtime, sender, MakeContinueRequest(sessionId, txId, Q_(R"(
+ auto result = KqpSimpleContinue(runtime, sessionId, txId, Q_(R"(
SELECT * FROM `/Root/table-1` WHERE key = 5
- )")));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS);
- UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u);
+ )"));
+ UNIT_ASSERT_VALUES_EQUAL(result, "");
}
{
Cerr << "... performing the last upsert and commit" << Endl;
- auto ev = ExecRequest(runtime, sender, MakeCommitRequest(sessionId, txId, Q_(R"(
+ auto result = KqpSimpleCommit(runtime, sessionId, txId, Q_(R"(
UPSERT INTO `/Root/table-1` (key, value) VALUES (5, 5)
- )")));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::ABORTED);
+ )"));
+ UNIT_ASSERT_VALUES_EQUAL(result, "ERROR: ABORTED");
}
}