aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxenoxeno <xeno@ydb.tech>2023-02-11 12:20:33 +0300
committerxenoxeno <xeno@ydb.tech>2023-02-11 12:20:33 +0300
commit0c02f9960488f7ba96f1c9bfa432420a9b634f0e (patch)
tree7bb87a41484e2eeeb63ada02fa58b5a9f016463a
parent8a728348276aae333a29994af7e4d19c3db9a3b0 (diff)
downloadydb-0c02f9960488f7ba96f1c9bfa432420a9b634f0e.tar.gz
ease test memory requirements
-rw-r--r--ydb/core/mind/hive/hive_impl_ut.cpp2
-rw-r--r--ydb/core/viewer/CMakeLists.darwin.txt2
-rw-r--r--ydb/core/viewer/CMakeLists.linux-aarch64.txt2
-rw-r--r--ydb/core/viewer/CMakeLists.linux.txt2
-rw-r--r--ydb/core/viewer/viewer_ut.cpp29
5 files changed, 30 insertions, 7 deletions
diff --git a/ydb/core/mind/hive/hive_impl_ut.cpp b/ydb/core/mind/hive/hive_impl_ut.cpp
index c9b3d0b18fc..38be4a4a0eb 100644
--- a/ydb/core/mind/hive/hive_impl_ut.cpp
+++ b/ydb/core/mind/hive/hive_impl_ut.cpp
@@ -29,7 +29,7 @@ using duration_nano_t = std::chrono::duration<ui64, std::nano>;
using duration_t = std::chrono::duration<double>;
duration_t GetBasePerformance() {
- duration_nano_t accm;
+ duration_nano_t accm{};
for (int i = 0; i < 1000000; ++i) {
accm += duration_nano_t(NActors::MeasureTaskDurationNs());
}
diff --git a/ydb/core/viewer/CMakeLists.darwin.txt b/ydb/core/viewer/CMakeLists.darwin.txt
index d08cebf12d5..f5cf94f3f5e 100644
--- a/ydb/core/viewer/CMakeLists.darwin.txt
+++ b/ydb/core/viewer/CMakeLists.darwin.txt
@@ -19,6 +19,7 @@ target_link_libraries(ydb-core-viewer PUBLIC
yutil
library-cpp-resource
cpp-actors-core
+ cpp-actors-helpers
library-cpp-archive
cpp-mime-types
cpp-protobuf-json
@@ -63,6 +64,7 @@ target_link_libraries(ydb-core-viewer.global PUBLIC
yutil
library-cpp-resource
cpp-actors-core
+ cpp-actors-helpers
library-cpp-archive
cpp-mime-types
cpp-protobuf-json
diff --git a/ydb/core/viewer/CMakeLists.linux-aarch64.txt b/ydb/core/viewer/CMakeLists.linux-aarch64.txt
index 2572c03e1ce..c6d4477b77b 100644
--- a/ydb/core/viewer/CMakeLists.linux-aarch64.txt
+++ b/ydb/core/viewer/CMakeLists.linux-aarch64.txt
@@ -20,6 +20,7 @@ target_link_libraries(ydb-core-viewer PUBLIC
yutil
library-cpp-resource
cpp-actors-core
+ cpp-actors-helpers
library-cpp-archive
cpp-mime-types
cpp-protobuf-json
@@ -65,6 +66,7 @@ target_link_libraries(ydb-core-viewer.global PUBLIC
yutil
library-cpp-resource
cpp-actors-core
+ cpp-actors-helpers
library-cpp-archive
cpp-mime-types
cpp-protobuf-json
diff --git a/ydb/core/viewer/CMakeLists.linux.txt b/ydb/core/viewer/CMakeLists.linux.txt
index 2572c03e1ce..c6d4477b77b 100644
--- a/ydb/core/viewer/CMakeLists.linux.txt
+++ b/ydb/core/viewer/CMakeLists.linux.txt
@@ -20,6 +20,7 @@ target_link_libraries(ydb-core-viewer PUBLIC
yutil
library-cpp-resource
cpp-actors-core
+ cpp-actors-helpers
library-cpp-archive
cpp-mime-types
cpp-protobuf-json
@@ -65,6 +66,7 @@ target_link_libraries(ydb-core-viewer.global PUBLIC
yutil
library-cpp-resource
cpp-actors-core
+ cpp-actors-helpers
library-cpp-archive
cpp-mime-types
cpp-protobuf-json
diff --git a/ydb/core/viewer/viewer_ut.cpp b/ydb/core/viewer/viewer_ut.cpp
index 8d04a1021bf..322ffec3021 100644
--- a/ydb/core/viewer/viewer_ut.cpp
+++ b/ydb/core/viewer/viewer_ut.cpp
@@ -1,6 +1,7 @@
#include <library/cpp/testing/unittest/registar.h>
#include <library/cpp/testing/unittest/tests_data.h>
#include <library/cpp/actors/interconnect/interconnect.h>
+#include <library/cpp/actors/helpers/selfping_actor.h>
#include <library/cpp/json/json_reader.h>
#include <util/stream/null.h>
#include <ydb/core/viewer/protos/viewer.pb.h>
@@ -19,13 +20,27 @@ using namespace NKikimrWhiteboard;
#define Ctest Cerr
#endif
+using duration_nano_t = std::chrono::duration<ui64, std::nano>;
+using duration_t = std::chrono::duration<double>;
+
+duration_t GetBasePerformance() {
+ duration_nano_t accm{};
+ for (int i = 0; i < 1000000; ++i) {
+ accm += duration_nano_t(NActors::MeasureTaskDurationNs());
+ }
+ return std::chrono::duration_cast<duration_t>(accm);
+}
+
+double BASE_PERF = GetBasePerformance().count();
+
Y_UNIT_TEST_SUITE(Viewer) {
Y_UNIT_TEST(TabletMerging) {
THPTimer timer;
+ Cerr << "BASE_PERF = " << BASE_PERF << Endl;
{
TMap<ui32, TString> nodesBlob;
timer.Reset();
- for (ui32 nodeId = 1; nodeId <= 10000; ++nodeId) {
+ for (ui32 nodeId = 1; nodeId <= 1000; ++nodeId) {
NKikimrWhiteboard::TEvTabletStateResponse nodeData;
nodeData.MutableTabletStateInfo()->Reserve(10000);
for (ui32 tabletId = 1; tabletId <= 10000; ++tabletId) {
@@ -54,7 +69,7 @@ Y_UNIT_TEST_SUITE(Viewer) {
NKikimrWhiteboard::TEvTabletStateResponse result;
MergeWhiteboardResponses(result, nodesData);
Ctest << "Merge = " << timer.Passed() << Endl;
- UNIT_ASSERT_LT(timer.Passed(), 30);
+ UNIT_ASSERT_LT(timer.Passed(), 8 * BASE_PERF);
UNIT_ASSERT_VALUES_EQUAL(result.TabletStateInfoSize(), 10000);
timer.Reset();
}
@@ -66,13 +81,15 @@ Y_UNIT_TEST_SUITE(Viewer) {
{
TMap<ui32, TString> nodesBlob;
timer.Reset();
- for (ui32 nodeId = 1; nodeId <= 10000; ++nodeId) {
+ for (ui32 nodeId = 1; nodeId <= 1000; ++nodeId) {
THolder<TEvWhiteboard::TEvTabletStateResponse> nodeData = MakeHolder<TEvWhiteboard::TEvTabletStateResponse>();
auto* tabletData = nodeData->AllocatePackedResponse(10000);
for (ui32 tabletId = 1; tabletId <= 10000; ++tabletId) {
tabletData->TabletId = tabletId;
tabletData->FollowerId = 0;
tabletData->Generation = 13;
+ tabletData->Type = NKikimrTabletBase::TTabletTypes::TxProxy;
+ tabletData->State = NKikimrWhiteboard::TTabletStateInfo::Restored;
//tabletData->SetChangeTime(TInstant::Now().MilliSeconds());
++tabletData;
}
@@ -89,7 +106,7 @@ Y_UNIT_TEST_SUITE(Viewer) {
NKikimrWhiteboard::TEvTabletStateResponse result;
MergeWhiteboardResponses(result, nodesData);
Ctest << "Merge = " << timer.Passed() << Endl;
- UNIT_ASSERT_LT(timer.Passed(), 10);
+ UNIT_ASSERT_LT(timer.Passed(), 2 * BASE_PERF);
UNIT_ASSERT_VALUES_EQUAL(result.TabletStateInfoSize(), 10000);
timer.Reset();
}
@@ -117,7 +134,7 @@ Y_UNIT_TEST_SUITE(Viewer) {
NKikimrWhiteboard::TEvVDiskStateResponse result;
MergeWhiteboardResponses(result, nodesData);
Ctest << "Merge = " << timer.Passed() << Endl;
- UNIT_ASSERT_LT(timer.Passed(), 10);
+ UNIT_ASSERT_LT(timer.Passed(), 10 * BASE_PERF);
UNIT_ASSERT_VALUES_EQUAL(result.VDiskStateInfoSize(), 1000);
Ctest << "Data has merged" << Endl;
}
@@ -139,7 +156,7 @@ Y_UNIT_TEST_SUITE(Viewer) {
NKikimrWhiteboard::TEvPDiskStateResponse result;
MergeWhiteboardResponses(result, nodesData);
Ctest << "Merge = " << timer.Passed() << Endl;
- UNIT_ASSERT_LT(timer.Passed(), 10);
+ UNIT_ASSERT_LT(timer.Passed(), 10 * BASE_PERF);
UNIT_ASSERT_VALUES_EQUAL(result.PDiskStateInfoSize(), 100000);
Ctest << "Data has merged" << Endl;
}