Skip to content

Commit

Permalink
[*] refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Alek5andr-Kotov committed Feb 14, 2025
1 parent e69d5d3 commit 8e1c44f
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 433 deletions.
26 changes: 19 additions & 7 deletions ydb/core/persqueue/ut/pq_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2429,21 +2429,33 @@ Y_UNIT_TEST(TestReadAndDeleteConsumer) {
});
}

void TestHowDoesABatchDownloadBlobsFromANewVersion(const TString& resourceName)
Y_UNIT_TEST(Test_The_Partition_And_Blob_Created_By_The_New_Version_1)
{
TTestContext tc;
TFinalizer finalizer(tc);
tc.Prepare();

PQTabletPrepareFromResource({.partitions = 1}, {}, resourceName, tc);
// This file contains all the combinations of neighboring keys. There are blobs in it
// if you write messages in the topic in this order
// * 15 420Kb
// * 1 9Mb
// * 1 2Mb
// * 1 4Mb
// * 1 5Mb
// * 5 100Kb
PQTabletPrepareFromResource({.partitions = 1}, {}, "new_version_topic.dat", tc);
}

Y_UNIT_TEST(Test_The_Partition_And_Blob_Created_By_The_New_Version)
Y_UNIT_TEST(Test_The_Partition_And_Blob_Created_By_The_New_Version_2)
{
TestHowDoesABatchDownloadBlobsFromANewVersion("new_version_topic.dat");
TestHowDoesABatchDownloadBlobsFromANewVersion("new_version_topic_many_parts_1.dat");
TestHowDoesABatchDownloadBlobsFromANewVersion("new_version_topic_many_parts_2.dat");
TestHowDoesABatchDownloadBlobsFromANewVersion("new_version_topic_many_parts_3.dat");
TTestContext tc;
TFinalizer finalizer(tc);
tc.Prepare();

// This test checks the situation when the user recorded several messages, but they did not have
// time to repackage them. Their keys end in `?`. It is expected that after restarting the partition,
// the keys will end in `|`.
PQTabletPrepareFromResource({.partitions = 1}, {}, "new_version_topic_only_user_writes.dat", tc);
}

} // Y_UNIT_TEST_SUITE(TPQTest)
Expand Down
359 changes: 27 additions & 332 deletions ydb/core/persqueue/ut/resources/new_version_topic.dat

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions ydb/core/persqueue/ut/resources/new_version_topic_many_parts_1.dat

This file was deleted.

Loading

0 comments on commit 8e1c44f

Please sign in to comment.