diff options
author | gvit <gvit@ydb.tech> | 2022-11-05 20:43:42 +0300 |
---|---|---|
committer | gvit <gvit@ydb.tech> | 2022-11-05 20:43:42 +0300 |
commit | a4190bfa860bebf00c9dd64a83ac021133a62e46 (patch) | |
tree | fc1a4f4e0b6bdb7f10567d339aa0800d7ed93fe6 | |
parent | b310c3247bb3d6bccce661537d33fad5e7cf2c65 (diff) | |
download | ydb-a4190bfa860bebf00c9dd64a83ac021133a62e46.tar.gz |
continue switching datashard tests to public api
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_order.cpp | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/ydb/core/tx/datashard/datashard_ut_order.cpp b/ydb/core/tx/datashard/datashard_ut_order.cpp index 0cc01c94164..dcf07e64433 100644 --- a/ydb/core/tx/datashard/datashard_ut_order.cpp +++ b/ydb/core/tx/datashard/datashard_ut_order.cpp @@ -1439,14 +1439,14 @@ Y_UNIT_TEST_TWIN(TestOutOfOrderLockLost, UseMvcc) { TString txId; { - auto ev = ExecRequest(runtime, sender, MakeBeginRequest(sessionId, Q_(R"( + auto result = KqpSimpleBegin(runtime, sessionId, txId, Q_(R"( SELECT * FROM `/Root/table-1` UNION ALL - SELECT * FROM `/Root/table-2`)"))); - auto& response = ev->Get()->Record.GetRef(); - UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS); - txId = response.GetResponse().GetTxMeta().id(); - UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u); + SELECT * FROM `/Root/table-2`)")); + UNIT_ASSERT_VALUES_EQUAL( + result, + "{ items { uint32_value: 1 } items { uint32_value: 1 } }, " + "{ items { uint32_value: 2 } items { uint32_value: 1 } }"); } // Capture and block all readset messages @@ -1575,14 +1575,14 @@ Y_UNIT_TEST(TestMvccReadDoesntBlockWrites) { TString txId; { - auto ev = ExecRequest(runtime, sender, MakeBeginRequest(sessionId, Q_(R"( + auto result = KqpSimpleBegin(runtime, sessionId, txId, Q_(R"( SELECT * FROM `/Root/table-1` UNION ALL - SELECT * FROM `/Root/table-2`)"))); - auto& response = ev->Get()->Record.GetRef(); - UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS); - txId = response.GetResponse().GetTxMeta().id(); - UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u); + SELECT * FROM `/Root/table-2`)")); + UNIT_ASSERT_VALUES_EQUAL( + result, + "{ items { uint32_value: 1 } items { uint32_value: 1 } }, " + "{ items { uint32_value: 2 } items { uint32_value: 2 } }"); } // Capture and block all readset messages @@ -1710,14 +1710,14 @@ Y_UNIT_TEST_TWIN(TestOutOfOrderReadOnlyAllowed, UseMvcc) { TString txId; { - auto ev = ExecRequest(runtime, sender, MakeBeginRequest(sessionId, Q_(R"( + auto result = KqpSimpleBegin(runtime, sessionId, txId, Q_(R"( SELECT * FROM `/Root/table-1` UNION ALL - SELECT * FROM `/Root/table-2`)"))); - auto& response = ev->Get()->Record.GetRef(); - UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS); - txId = response.GetResponse().GetTxMeta().id(); - UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u); + SELECT * FROM `/Root/table-2`)")); + UNIT_ASSERT_VALUES_EQUAL( + result, + "{ items { uint32_value: 1 } items { uint32_value: 1 } }, " + "{ items { uint32_value: 2 } items { uint32_value: 1 } }"); } // Capture and block all readset messages @@ -1820,14 +1820,14 @@ Y_UNIT_TEST_TWIN(TestOutOfOrderNonConflictingWrites, UseMvcc) { TString txId; { - auto ev = ExecRequest(runtime, sender, MakeBeginRequest(sessionId, Q_(R"( + auto result = KqpSimpleBegin(runtime, sessionId, txId, Q_(R"( SELECT * FROM `/Root/table-1` WHERE key = 1 UNION ALL - SELECT * FROM `/Root/table-2` WHERE key = 2)"))); - auto& response = ev->Get()->Record.GetRef(); - UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS); - txId = response.GetResponse().GetTxMeta().id(); - UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u); + SELECT * FROM `/Root/table-2` WHERE key = 2)")); + UNIT_ASSERT_VALUES_EQUAL( + result, + "{ items { uint32_value: 1 } items { uint32_value: 1 } }, " + "{ items { uint32_value: 2 } items { uint32_value: 1 } }"); } // Capture and block all readset messages @@ -1941,15 +1941,14 @@ Y_UNIT_TEST(TestOutOfOrderRestartLocksSingleWithoutBarrier) { TString txId; { - auto sender1 = runtime.AllocateEdgeActor(); - auto ev = ExecRequest(runtime, sender1, MakeBeginRequest(sessionId, Q_(R"( + auto result = KqpSimpleBegin(runtime, sessionId, txId, Q_(R"( SELECT * FROM `/Root/table-1` WHERE key = 1 UNION ALL - SELECT * FROM `/Root/table-2` WHERE key = 2)"))); - auto& response = ev->Get()->Record.GetRef(); - UNIT_ASSERT_VALUES_EQUAL(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS); - txId = response.GetResponse().GetTxMeta().id(); - UNIT_ASSERT_VALUES_EQUAL(response.GetResponse().GetResults().size(), 1u); + SELECT * FROM `/Root/table-2` WHERE key = 2)")); + UNIT_ASSERT_VALUES_EQUAL( + result, + "{ items { uint32_value: 1 } items { uint32_value: 1 } }, " + "{ items { uint32_value: 2 } items { uint32_value: 1 } }"); } // Capture and block all readset messages |