aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgvit <gvit@ydb.tech>2022-11-05 20:05:44 +0300
committergvit <gvit@ydb.tech>2022-11-05 20:05:44 +0300
commitb310c3247bb3d6bccce661537d33fad5e7cf2c65 (patch)
tree2869afedb06ae6c60a9a8133f562fcc7d3958873
parent2c9d96a45fc20372f08fbab8a952ece73b406594 (diff)
downloadydb-b310c3247bb3d6bccce661537d33fad5e7cf2c65.tar.gz
continue switching datashard tests to public api
-rw-r--r--ydb/core/tx/datashard/datashard_ut_common_kqp.h18
-rw-r--r--ydb/core/tx/datashard/datashard_ut_order.cpp30
2 files changed, 8 insertions, 40 deletions
diff --git a/ydb/core/tx/datashard/datashard_ut_common_kqp.h b/ydb/core/tx/datashard/datashard_ut_common_kqp.h
index f3713336fcb..50a0bbd6a40 100644
--- a/ydb/core/tx/datashard/datashard_ut_common_kqp.h
+++ b/ydb/core/tx/datashard/datashard_ut_common_kqp.h
@@ -112,24 +112,6 @@ namespace NKqpHelpers {
return request;
}
- inline THolder<NKqp::TEvKqp::TEvQueryRequest> MakeContinueRequest(
- const TString& sessionId,
- const TString& txId,
- const TString& sql,
- const TString& database = {})
- {
- auto request = MakeHolder<NKqp::TEvKqp::TEvQueryRequest>();
- request->Record.MutableRequest()->SetSessionId(sessionId);
- request->Record.MutableRequest()->MutableTxControl()->set_tx_id(txId);
- request->Record.MutableRequest()->SetAction(NKikimrKqp::QUERY_ACTION_EXECUTE);
- request->Record.MutableRequest()->SetType(NKikimrKqp::QUERY_TYPE_SQL_DML);
- request->Record.MutableRequest()->SetQuery(sql);
- if (!database.empty()) {
- request->Record.MutableRequest()->SetDatabase(database);
- }
- return request;
- }
-
inline THolder<NKqp::TEvKqp::TEvQueryRequest> MakeCommitRequest(
const TString& sessionId,
const TString& txId,
diff --git a/ydb/core/tx/datashard/datashard_ut_order.cpp b/ydb/core/tx/datashard/datashard_ut_order.cpp
index 0b50c6e6b20..0cc01c94164 100644
--- a/ydb/core/tx/datashard/datashard_ut_order.cpp
+++ b/ydb/core/tx/datashard/datashard_ut_order.cpp
@@ -4642,12 +4642,7 @@ Y_UNIT_TEST_TWIN(TestSnapshotReadPriority, UnprotectedReads) {
};
auto continueSnapshotRequest = [&](const TString& sessionId, const TString& txId, const TString& query) -> TString {
- auto reqSender = runtime.AllocateEdgeActor();
- auto ev = ExecRequest(runtime, reqSender, MakeContinueRequest(sessionId, txId, query));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS);
- UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u);
- return response.GetResponse().GetResults()[0].GetValue().ShortDebugString();
+ return KqpSimpleContinue(runtime, sessionId, txId, query);
};
auto execSnapshotRequest = [&](const TString& query) -> TString {
@@ -4877,13 +4872,11 @@ Y_UNIT_TEST_TWIN(TestSnapshotReadPriority, UnprotectedReads) {
SELECT key, value FROM `/Root/table-1`
ORDER BY key
)")),
- "Struct { "
- "List { Struct { Optional { Uint32: 1 } } Struct { Optional { Uint32: 1 } } } "
- "List { Struct { Optional { Uint32: 3 } } Struct { Optional { Uint32: 3 } } } "
- "List { Struct { Optional { Uint32: 5 } } Struct { Optional { Uint32: 5 } } } "
- "List { Struct { Optional { Uint32: 7 } } Struct { Optional { Uint32: 7 } } } "
- "List { Struct { Optional { Uint32: 9 } } Struct { Optional { Uint32: 9 } } } "
- "} Struct { Bool: false }");
+ "{ items { uint32_value: 1 } items { uint32_value: 1 } }, "
+ "{ items { uint32_value: 3 } items { uint32_value: 3 } }, "
+ "{ items { uint32_value: 5 } items { uint32_value: 5 } }, "
+ "{ items { uint32_value: 7 } items { uint32_value: 7 } }, "
+ "{ items { uint32_value: 9 } items { uint32_value: 9 } }");
// Make sure new snapshot will actually observe new data
UNIT_ASSERT_VALUES_EQUAL(
@@ -5036,12 +5029,7 @@ Y_UNIT_TEST(TestUnprotectedReadsThenWriteVisibility) {
};
auto continueSnapshotRequest = [&](const TString& sessionId, const TString& txId, const TString& query) -> TString {
- auto reqSender = runtime.AllocateEdgeActor();
- auto ev = ExecRequest(runtime, reqSender, MakeContinueRequest(sessionId, txId, query));
- auto& response = ev->Get()->Record.GetRef();
- UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS);
- UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u);
- return response.GetResponse().GetResults()[0].GetValue().ShortDebugString();
+ return KqpSimpleContinue(runtime, sessionId, txId, query);
};
auto execSnapshotRequest = [&](const TString& query) -> TString {
@@ -5102,9 +5090,7 @@ Y_UNIT_TEST(TestUnprotectedReadsThenWriteVisibility) {
SELECT key, value FROM `/Root/table-1`
ORDER BY key
)")),
- "Struct { "
- "List { Struct { Optional { Uint32: 1 } } Struct { Optional { Uint32: 1 } } } "
- "} Struct { Bool: false }");
+ "{ items { uint32_value: 1 } items { uint32_value: 1 } }");
// However new snapshots must see updated data
UNIT_ASSERT_VALUES_EQUAL(