diff options
author | snaury <snaury@ydb.tech> | 2023-02-16 15:10:17 +0300 |
---|---|---|
committer | snaury <snaury@ydb.tech> | 2023-02-16 15:10:17 +0300 |
commit | 722e18210f7daf85f0381ff09afa83c9222c623d (patch) | |
tree | eb4ec69fb5c4356f7738c70793ca57fe7597cd3b | |
parent | 0d0b845029fb97dbb7b722d667c72eb17649a048 (diff) | |
download | ydb-722e18210f7daf85f0381ff09afa83c9222c623d.tar.gz |
Fix AutoSplitMergeQueue test to work with mvcc
-rw-r--r-- | ydb/core/client/flat_ut.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/ydb/core/client/flat_ut.cpp b/ydb/core/client/flat_ut.cpp index f53613ab95f..819f12bfa1c 100644 --- a/ydb/core/client/flat_ut.cpp +++ b/ydb/core/client/flat_ut.cpp @@ -3011,7 +3011,7 @@ Y_UNIT_TEST_SUITE(TFlatTest) { } void WriteKVRow(TFlatMsgBusClient& annoyingClient, ui32 key, TString value) { - Cerr << key << Endl; + Cerr << "WriteKVRow: " << key << Endl; TString insertRowQuery = R"___( ( (let key '('('Key (Uint32 '%u)))) @@ -3024,13 +3024,15 @@ Y_UNIT_TEST_SUITE(TFlatTest) { )___"; int retryCnt = 20; + TDuration delay = TDuration::MilliSeconds(5); while (retryCnt--) { TFlatMsgBusClient::TFlatQueryOptions opts; NKikimrClient::TResponse response; annoyingClient.FlatQueryRaw(Sprintf(insertRowQuery.data(), key, value.data(), "T1"), opts, response); ui32 responseStatus = response.GetStatus(); if (responseStatus == NMsgBusProxy::MSTATUS_REJECTED) { - Sleep(TDuration::Seconds(1)); + Sleep(delay); + delay = Min(delay * 2, TDuration::Seconds(1)); } else { UNIT_ASSERT_VALUES_EQUAL(responseStatus, NMsgBusProxy::MSTATUS_OK); break; @@ -3039,7 +3041,7 @@ Y_UNIT_TEST_SUITE(TFlatTest) { } void EraseKVRow(TFlatMsgBusClient& annoyingClient, ui32 key) { - Cerr << key << Endl; + Cerr << "EraseKVRow: " << key << Endl; TString query = R"___( ( (let key '('('Key (Uint32 '%u)))) @@ -3051,13 +3053,15 @@ Y_UNIT_TEST_SUITE(TFlatTest) { )___"; int retryCnt = 20; + TDuration delay = TDuration::MilliSeconds(5); while (retryCnt--) { TFlatMsgBusClient::TFlatQueryOptions opts; NKikimrClient::TResponse response; annoyingClient.FlatQueryRaw(Sprintf(query.data(), key, "T1"), opts, response); ui32 responseStatus = response.GetStatus(); if (responseStatus == NMsgBusProxy::MSTATUS_REJECTED) { - Sleep(TDuration::Seconds(1)); + Sleep(delay); + delay = Min(delay * 2, TDuration::Seconds(1)); } else { UNIT_ASSERT_VALUES_EQUAL(responseStatus, NMsgBusProxy::MSTATUS_OK); break; @@ -3172,7 +3176,6 @@ Y_UNIT_TEST_SUITE(TFlatTest) { UNIT_ASSERT_VALUES_EQUAL(partitions.size(), 6); } -/* // to be fixed in KIKIMR-17201 Y_UNIT_TEST(AutoSplitMergeQueue) { TPortManager pm; ui16 port = pm.GetPort(2134); @@ -3205,6 +3208,14 @@ Y_UNIT_TEST_SUITE(TFlatTest) { ReadAheadLoThreshold: 100000 MinDataPageSize: 7168 SnapBrokerQueue: 0 + Generation { + GenerationId: 0 + SizeToCompact: 10000 + CountToCompact: 2 + ForceCountToCompact: 2 + ForceSizeToCompact: 20000 + KeepInCache: true + } } } )___"; @@ -3248,7 +3259,6 @@ Y_UNIT_TEST_SUITE(TFlatTest) { UNIT_ASSERT_VALUES_EQUAL_C(finalPartitions.size(), 1, "Empty table didn't merge into 1 shard"); UNIT_ASSERT_VALUES_UNEQUAL_C(finalPartitions[0], initialPartitions[0], "Partitions din't change"); } -*/ Y_UNIT_TEST(GetTabletCounters) { TPortManager pm; |