1010#include < util/generic/overloaded.h>
1111#include < util/stream/zlib.h>
1212
13- #include < future>
14-
13+ #include < gtest/gtest.h>
1514
16- static const bool EnableDirectRead = !std::string{ std::getenv ( " PQ_EXPERIMENTAL_DIRECT_READ " ) ? std::getenv ( " PQ_EXPERIMENTAL_DIRECT_READ " ) : " " }.empty();
15+ # include < future >
1716
1817
1918namespace NYdb ::inline V3::NPersQueue::NTests {
@@ -174,7 +173,7 @@ TIntrusivePtr<TManagedExecutor> CreateSyncManagedExecutor()
174173
175174class BasicUsage : public TTopicTestFixture {};
176175
177- TEST_F (BasicUsage, ConnectToYDB) {
176+ TEST_F (BasicUsage, TEST_NAME( ConnectToYDB) ) {
178177 auto cfg = NYdb::TDriverConfig ()
179178 .SetEndpoint (" invalid:2136" )
180179 .SetDatabase (" /Invalid" )
@@ -213,7 +212,7 @@ TEST_F(BasicUsage, ConnectToYDB) {
213212 }
214213}
215214
216- TEST_F (BasicUsage, WriteRead) {
215+ TEST_F (BasicUsage, TEST_NAME( WriteRead) ) {
217216 auto driver = MakeDriver ();
218217
219218 TTopicClient client (driver);
@@ -245,7 +244,7 @@ TEST_F(BasicUsage, WriteRead) {
245244
246245 {
247246 auto readSettings = TReadSessionSettings ()
248- .ConsumerName (" test-consumer " )
247+ .ConsumerName (GetConsumerName () )
249248 .AppendTopics (GetTopicPath ())
250249 // .DirectRead(EnableDirectRead)
251250 ;
@@ -270,7 +269,7 @@ TEST_F(BasicUsage, WriteRead) {
270269 }
271270}
272271
273- TEST_F (BasicUsage, MaxByteSizeEqualZero) {
272+ TEST_F (BasicUsage, TEST_NAME( MaxByteSizeEqualZero) ) {
274273 auto driver = MakeDriver ();
275274
276275 TTopicClient client (driver);
@@ -283,7 +282,7 @@ TEST_F(BasicUsage, MaxByteSizeEqualZero) {
283282 writeSession->Close ();
284283
285284 auto readSettings = TReadSessionSettings ()
286- .ConsumerName (" test-consumer " )
285+ .ConsumerName (GetConsumerName () )
287286 .AppendTopics (GetTopicPath ())
288287 // .DirectRead(EnableDirectRead)
289288 ;
@@ -305,7 +304,7 @@ TEST_F(BasicUsage, MaxByteSizeEqualZero) {
305304 dataReceived.Commit ();
306305}
307306
308- TEST_F (BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
307+ TEST_F (BasicUsage, TEST_NAME( WriteAndReadSomeMessagesWithSyncCompression) ) {
309308 auto driver = MakeDriver ();
310309
311310 IExecutor::TPtr executor = new TSyncExecutor ();
@@ -353,7 +352,7 @@ TEST_F(BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
353352 // Create read session.
354353 TReadSessionSettings readSettings;
355354 readSettings
356- .ConsumerName (" test-consumer " )
355+ .ConsumerName (GetConsumerName () )
357356 .MaxMemoryUsageBytes (1_MB)
358357 .AppendTopics (GetTopicPath ())
359358 // .DirectRead(EnableDirectRead)
@@ -387,11 +386,11 @@ TEST_F(BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
387386 ReadSession->Close (TDuration::MilliSeconds (10 ));
388387 check.store (0 );
389388
390- auto status = topicClient.CommitOffset (GetTopicPath (), 0 , " test-consumer " , 50 );
389+ auto status = topicClient.CommitOffset (GetTopicPath (), 0 , GetConsumerName () , 50 );
391390 ASSERT_TRUE (status.GetValueSync ().IsSuccess ());
392391
393392 auto describeConsumerSettings = TDescribeConsumerSettings ().IncludeStats (true );
394- auto result = topicClient.DescribeConsumer (GetTopicPath (), " test-consumer " , describeConsumerSettings).GetValueSync ();
393+ auto result = topicClient.DescribeConsumer (GetTopicPath (), GetConsumerName () , describeConsumerSettings).GetValueSync ();
395394 ASSERT_TRUE (result.IsSuccess ());
396395
397396 auto description = result.GetConsumerDescription ();
@@ -401,7 +400,7 @@ TEST_F(BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
401400 ASSERT_EQ (stats->GetCommittedOffset (), 50u );
402401}
403402
404- TEST_F (BasicUsage, SessionNotDestroyedWhileCompressionInFlight) {
403+ TEST_F (BasicUsage, TEST_NAME( SessionNotDestroyedWhileCompressionInFlight) ) {
405404 auto driver = MakeDriver ();
406405
407406 // controlled executor
@@ -425,7 +424,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileCompressionInFlight) {
425424 // Create read session.
426425 TReadSessionSettings readSettings;
427426 readSettings
428- .ConsumerName (" test-consumer " )
427+ .ConsumerName (GetConsumerName () )
429428 .MaxMemoryUsageBytes (1_MB)
430429 .AppendTopics (GetTopicPath ())
431430 .DecompressionExecutor (stepByStepExecutor)
@@ -511,7 +510,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileCompressionInFlight) {
511510 std::cerr << " >>> TEST: gracefully closed" << std::endl;
512511}
513512
514- TEST_F (BasicUsage, SessionNotDestroyedWhileUserEventHandlingInFlight) {
513+ TEST_F (BasicUsage, TEST_NAME( SessionNotDestroyedWhileUserEventHandlingInFlight) ) {
515514 auto driver = MakeDriver ();
516515
517516 // controlled executor
@@ -542,7 +541,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileUserEventHandlingInFlight) {
542541
543542 // Create read session.
544543 auto readSettings = TReadSessionSettings ()
545- .ConsumerName (" test-consumer " )
544+ .ConsumerName (GetConsumerName () )
546545 .MaxMemoryUsageBytes (1_MB)
547546 .AppendTopics (GetTopicPath ())
548547 // .DirectRead(EnableDirectRead)
@@ -643,7 +642,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileUserEventHandlingInFlight) {
643642 std::cerr << " >>> TEST: gracefully closed" << std::endl;
644643}
645644
646- TEST_F (BasicUsage, ReadSessionCorrectClose) {
645+ TEST_F (BasicUsage, TEST_NAME( ReadSessionCorrectClose) ) {
647646 auto driver = MakeDriver ();
648647
649648 NPersQueue::TWriteSessionSettings writeSettings;
@@ -672,7 +671,7 @@ TEST_F(BasicUsage, ReadSessionCorrectClose) {
672671 // Create read session.
673672 NYdb::NTopic::TReadSessionSettings readSettings;
674673 readSettings
675- .ConsumerName (" test-consumer " )
674+ .ConsumerName (GetConsumerName () )
676675 .MaxMemoryUsageBytes (1_MB)
677676 .Decompress (false )
678677 .RetryPolicy (NYdb::NTopic::IRetryPolicy::GetNoRetryPolicy ())
@@ -700,7 +699,7 @@ TEST_F(BasicUsage, ReadSessionCorrectClose) {
700699 std::this_thread::sleep_for (std::chrono::seconds (5 ));
701700}
702701
703- TEST_F (BasicUsage, ConfirmPartitionSessionWithCommitOffset) {
702+ TEST_F (BasicUsage, TEST_NAME( ConfirmPartitionSessionWithCommitOffset) ) {
704703 // TStartPartitionSessionEvent::Confirm(readOffset, commitOffset) should work,
705704 // if commitOffset passed to Confirm is greater than the offset committed previously by the consumer.
706705 // https://st.yandex-team.ru/KIKIMR-23015
@@ -723,7 +722,7 @@ TEST_F(BasicUsage, ConfirmPartitionSessionWithCommitOffset) {
723722 {
724723 // Read messages:
725724 auto settings = NTopic::TReadSessionSettings ()
726- .ConsumerName (" test-consumer " )
725+ .ConsumerName (GetConsumerName () )
727726 .AppendTopics (GetTopicPath ())
728727 // .DirectRead(EnableDirectRead)
729728 ;
@@ -760,7 +759,7 @@ TEST_F(BasicUsage, ConfirmPartitionSessionWithCommitOffset) {
760759 }
761760}
762761
763- TEST_F (BasicUsage, TWriteSession_WriteEncoded) {
762+ TEST_F (BasicUsage, TEST_NAME( TWriteSession_WriteEncoded) ) {
764763 // This test was adapted from ydb_persqueue tests.
765764 // It writes 4 messages: 2 with default codec, 1 with explicitly set GZIP codec, 1 with RAW codec.
766765 // The last message MUST be sent in a separate WriteRequest, as it has a codec field applied for all messages in the request.
@@ -831,7 +830,7 @@ TEST_F(BasicUsage, TWriteSession_WriteEncoded) {
831830 ASSERT_EQ (tokens, 2u );
832831
833832 auto readSettings = TReadSessionSettings ()
834- .ConsumerName (" test-consumer " )
833+ .ConsumerName (GetConsumerName () )
835834 .AppendTopics (GetTopicPath ())
836835 // .DirectRead(EnableDirectRead)
837836 ;
@@ -886,7 +885,7 @@ namespace {
886885
887886class TSettingsValidation : public TTopicTestFixture {};
888887
889- TEST_F (TSettingsValidation, TestDifferentDedupParams) {
888+ TEST_F (TSettingsValidation, TEST_NAME( TestDifferentDedupParams) ) {
890889 char * ydbVersion = std::getenv (" YDB_VERSION" );
891890 if (ydbVersion != nullptr && std::string (ydbVersion) != " trunk" && std::string (ydbVersion) < " 24.3" ) {
892891 GTEST_SKIP () << " Skipping test for YDB version " << ydbVersion;
@@ -1003,13 +1002,13 @@ TEST_F(TSettingsValidation, TestDifferentDedupParams) {
10031002 runTest ({}, " msgGroup" , {}, false , EExpectedTestResult::SUCCESS);
10041003}
10051004
1006- TEST_F (TSettingsValidation, ValidateSettingsFailOnStart) {
1005+ TEST_F (TSettingsValidation, TEST_NAME( ValidateSettingsFailOnStart) ) {
10071006 auto driver = MakeDriver ();
10081007
10091008 TTopicClient client (driver);
10101009
10111010 auto readSettings = TReadSessionSettings ()
1012- .ConsumerName (" test-consumer " )
1011+ .ConsumerName (GetConsumerName () )
10131012 .MaxMemoryUsageBytes (0 )
10141013 .AppendTopics (GetTopicPath ())
10151014 // .DirectRead(EnableDirectRead)
0 commit comments