Skip to content

Commit 7d865ab

Browse files
Moved commit "The DescripeTopic call with the IncludeStats flag freezes" from ydb repo
1 parent 4169e81 commit 7d865ab

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/client/topic/ut/topic_to_table_ut.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class TFixture : public NUnitTest::TBaseFixture {
6666
size_t partitionCount = 1,
6767
std::optional<size_t> maxPartitionCount = std::nullopt);
6868

69+
void DescribeTopic(const TString& path);
70+
6971
void WriteToTopicWithInvalidTxId(bool invalidTxId);
7072

7173
TTopicWriteSessionPtr CreateTopicWriteSession(const TString& topicPath,
@@ -328,6 +330,11 @@ void TFixture::CreateTopic(const TString& path,
328330
Setup->CreateTopic(path, consumer, partitionCount, maxPartitionCount);
329331
}
330332

333+
void TFixture::DescribeTopic(const TString& path)
334+
{
335+
Setup->DescribeTopic(path);
336+
}
337+
331338
const TDriver& TFixture::GetDriver() const
332339
{
333340
return *Driver;
@@ -1122,6 +1129,8 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_6, TFixture)
11221129
UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1");
11231130
UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #2");
11241131
}
1132+
1133+
DescribeTopic("topic_A");
11251134
}
11261135

11271136
Y_UNIT_TEST_F(WriteToTopic_Demo_7, TFixture)

src/client/topic/ut/ut_utils/topic_sdk_test_setup.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ void TTopicSdkTestSetup::CreateTopic(const TString& path, const TString& consume
5252
Server.WaitInit(path);
5353
}
5454

55+
void TTopicSdkTestSetup::DescribeTopic(const TString& path)
56+
{
57+
TTopicClient client(MakeDriver());
58+
59+
TDescribeTopicSettings settings;
60+
settings.IncludeStats(true);
61+
settings.IncludeLocation(true);
62+
63+
auto status = client.DescribeTopic(path, settings).GetValueSync();
64+
UNIT_ASSERT(status.IsSuccess());
65+
}
66+
5567
TString TTopicSdkTestSetup::GetEndpoint() const {
5668
return "localhost:" + ToString(Server.GrpcPort);
5769
}

src/client/topic/ut/ut_utils/topic_sdk_test_setup.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class TTopicSdkTestSetup {
2121
void CreateTopicWithAutoscale(const TString& path = TString{TEST_TOPIC}, const TString& consumer = TEST_CONSUMER, size_t partitionCount = 1,
2222
size_t maxPartitionCount = 100);
2323

24+
void DescribeTopic(const TString& path = TEST_TOPIC);
25+
2426
TString GetEndpoint() const;
2527
TString GetTopicPath(const TString& name = TString{TEST_TOPIC}) const;
2628
TString GetTopicParent() const;

0 commit comments

Comments
 (0)