diff options
author | senya0x5f <senya0x5f@yandex-team.com> | 2023-11-22 16:19:06 +0300 |
---|---|---|
committer | senya0x5f <senya0x5f@yandex-team.com> | 2023-11-22 19:52:36 +0300 |
commit | 9542b1bc4af77566d86105846eca1dc2f4638405 (patch) | |
tree | 9e461503ec8f9c6514d6734410936eb765afe169 | |
parent | 236f00f96f1bf6723edb06e06d8d918377829597 (diff) | |
download | ydb-9542b1bc4af77566d86105846eca1dc2f4638405.tar.gz |
KIKIMR-19443 Fix ut multiget and space check timeout
-rw-r--r-- | ydb/core/blobstorage/ut_blobstorage/multiget.cpp | 23 | ||||
-rw-r--r-- | ydb/core/blobstorage/ut_blobstorage/space_check.cpp | 6 |
2 files changed, 14 insertions, 15 deletions
diff --git a/ydb/core/blobstorage/ut_blobstorage/multiget.cpp b/ydb/core/blobstorage/ut_blobstorage/multiget.cpp index 04127e8da7..bcd55908f9 100644 --- a/ydb/core/blobstorage/ut_blobstorage/multiget.cpp +++ b/ydb/core/blobstorage/ut_blobstorage/multiget.cpp @@ -18,26 +18,22 @@ Y_UNIT_TEST_SUITE(MultiGet) { } ui32 numInFlight = 0; - auto wait = [&](ui32 max) { - for (; numInFlight > max; --numInFlight) { - auto res = env.WaitForEdgeActorEvent<TEvBlobStorage::TEvPutResult>(edge, false); - UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::OK); - } - }; - - for (ui32 i = 1; i <= 1000000; ++i) { + + constexpr ui32 blobsToSend = 10'000; + + for (ui32 i = 1; i <= blobsToSend; ++i) { const TString buffer = "A SMALL BLOB 16b"; const TLogoBlobID id(1, 1, i, 0, buffer.size(), 0); runtime->WrapInActorContext(edge, [&] { SendToBSProxy(edge, groupId, new TEvBlobStorage::TEvPut(id, buffer, TInstant::Max())); }); ++numInFlight; - wait(16); - if (i % 1000 == 0) { - Cerr << i << "\r"; - } } - wait(0); + + for (; numInFlight > 0; --numInFlight) { + auto res = env.WaitForEdgeActorEvent<TEvBlobStorage::TEvPutResult>(edge, false); + UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::OK); + } auto rusage = TRusage::Get(); const ui64 rssOnBegin = rusage.MaxRss; @@ -50,6 +46,7 @@ Y_UNIT_TEST_SUITE(MultiGet) { }); { auto res = env.WaitForEdgeActorEvent<TEvBlobStorage::TEvRangeResult>(edge, false); + UNIT_ASSERT_EQUAL(res->Get()->Responses.size(), blobsToSend); UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::OK); } diff --git a/ydb/core/blobstorage/ut_blobstorage/space_check.cpp b/ydb/core/blobstorage/ut_blobstorage/space_check.cpp index e40c65e973..ad44ab4a59 100644 --- a/ydb/core/blobstorage/ut_blobstorage/space_check.cpp +++ b/ydb/core/blobstorage/ut_blobstorage/space_check.cpp @@ -131,6 +131,7 @@ Y_UNIT_TEST_SUITE(SpaceCheckForDiskReassign) { ui32 numIterations = 0; ui32 numCyclesWithoutProgress = 0; constexpr ui32 maxCyclesWithoutProgress = 1; // mins after full replication + constexpr ui32 targetIterations = 50; for (;;) { request.Clear(); @@ -159,9 +160,10 @@ Y_UNIT_TEST_SUITE(SpaceCheckForDiskReassign) { } } if (notReady) { - env.Sim(TDuration::Seconds(15)); + env.Sim(TDuration::Seconds(30)); continue; } + if (faultyVSlots && numCyclesWithoutProgress < maxCyclesWithoutProgress) { env.Sim(TDuration::Minutes(1)); ++numCyclesWithoutProgress; @@ -194,7 +196,7 @@ Y_UNIT_TEST_SUITE(SpaceCheckForDiskReassign) { Cerr << "numIterations# " << numIterations << " numFaulty# " << faultyPDiskIds.size() << " numCyclesWithoutProgress# " << numCyclesWithoutProgress << Endl; numCyclesWithoutProgress = 0; - if (numIterations == 2000) { + if (numIterations == targetIterations) { break; } } |