10
10
#include < util/generic/overloaded.h>
11
11
#include < util/stream/zlib.h>
12
12
13
- #include < future>
14
-
13
+ #include < gtest/gtest.h>
15
14
16
- static const bool EnableDirectRead = !std::string{ std::getenv ( " PQ_EXPERIMENTAL_DIRECT_READ " ) ? std::getenv ( " PQ_EXPERIMENTAL_DIRECT_READ " ) : " " }.empty();
15
+ # include < future >
17
16
18
17
19
18
namespace NYdb ::inline V3::NPersQueue::NTests {
@@ -174,7 +173,7 @@ TIntrusivePtr<TManagedExecutor> CreateSyncManagedExecutor()
174
173
175
174
class BasicUsage : public TTopicTestFixture {};
176
175
177
- TEST_F (BasicUsage, ConnectToYDB) {
176
+ TEST_F (BasicUsage, TEST_NAME( ConnectToYDB) ) {
178
177
auto cfg = NYdb::TDriverConfig ()
179
178
.SetEndpoint (" invalid:2136" )
180
179
.SetDatabase (" /Invalid" )
@@ -213,7 +212,7 @@ TEST_F(BasicUsage, ConnectToYDB) {
213
212
}
214
213
}
215
214
216
- TEST_F (BasicUsage, WriteRead) {
215
+ TEST_F (BasicUsage, TEST_NAME( WriteRead) ) {
217
216
auto driver = MakeDriver ();
218
217
219
218
TTopicClient client (driver);
@@ -245,7 +244,7 @@ TEST_F(BasicUsage, WriteRead) {
245
244
246
245
{
247
246
auto readSettings = TReadSessionSettings ()
248
- .ConsumerName (" test-consumer " )
247
+ .ConsumerName (GetConsumerName () )
249
248
.AppendTopics (GetTopicPath ())
250
249
// .DirectRead(EnableDirectRead)
251
250
;
@@ -270,7 +269,7 @@ TEST_F(BasicUsage, WriteRead) {
270
269
}
271
270
}
272
271
273
- TEST_F (BasicUsage, MaxByteSizeEqualZero) {
272
+ TEST_F (BasicUsage, TEST_NAME( MaxByteSizeEqualZero) ) {
274
273
auto driver = MakeDriver ();
275
274
276
275
TTopicClient client (driver);
@@ -283,7 +282,7 @@ TEST_F(BasicUsage, MaxByteSizeEqualZero) {
283
282
writeSession->Close ();
284
283
285
284
auto readSettings = TReadSessionSettings ()
286
- .ConsumerName (" test-consumer " )
285
+ .ConsumerName (GetConsumerName () )
287
286
.AppendTopics (GetTopicPath ())
288
287
// .DirectRead(EnableDirectRead)
289
288
;
@@ -305,7 +304,7 @@ TEST_F(BasicUsage, MaxByteSizeEqualZero) {
305
304
dataReceived.Commit ();
306
305
}
307
306
308
- TEST_F (BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
307
+ TEST_F (BasicUsage, TEST_NAME( WriteAndReadSomeMessagesWithSyncCompression) ) {
309
308
auto driver = MakeDriver ();
310
309
311
310
IExecutor::TPtr executor = new TSyncExecutor ();
@@ -353,7 +352,7 @@ TEST_F(BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
353
352
// Create read session.
354
353
TReadSessionSettings readSettings;
355
354
readSettings
356
- .ConsumerName (" test-consumer " )
355
+ .ConsumerName (GetConsumerName () )
357
356
.MaxMemoryUsageBytes (1_MB)
358
357
.AppendTopics (GetTopicPath ())
359
358
// .DirectRead(EnableDirectRead)
@@ -387,11 +386,11 @@ TEST_F(BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
387
386
ReadSession->Close (TDuration::MilliSeconds (10 ));
388
387
check.store (0 );
389
388
390
- auto status = topicClient.CommitOffset (GetTopicPath (), 0 , " test-consumer " , 50 );
389
+ auto status = topicClient.CommitOffset (GetTopicPath (), 0 , GetConsumerName () , 50 );
391
390
ASSERT_TRUE (status.GetValueSync ().IsSuccess ());
392
391
393
392
auto describeConsumerSettings = TDescribeConsumerSettings ().IncludeStats (true );
394
- auto result = topicClient.DescribeConsumer (GetTopicPath (), " test-consumer " , describeConsumerSettings).GetValueSync ();
393
+ auto result = topicClient.DescribeConsumer (GetTopicPath (), GetConsumerName () , describeConsumerSettings).GetValueSync ();
395
394
ASSERT_TRUE (result.IsSuccess ());
396
395
397
396
auto description = result.GetConsumerDescription ();
@@ -401,7 +400,7 @@ TEST_F(BasicUsage, WriteAndReadSomeMessagesWithSyncCompression) {
401
400
ASSERT_EQ (stats->GetCommittedOffset (), 50u );
402
401
}
403
402
404
- TEST_F (BasicUsage, SessionNotDestroyedWhileCompressionInFlight) {
403
+ TEST_F (BasicUsage, TEST_NAME( SessionNotDestroyedWhileCompressionInFlight) ) {
405
404
auto driver = MakeDriver ();
406
405
407
406
// controlled executor
@@ -425,7 +424,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileCompressionInFlight) {
425
424
// Create read session.
426
425
TReadSessionSettings readSettings;
427
426
readSettings
428
- .ConsumerName (" test-consumer " )
427
+ .ConsumerName (GetConsumerName () )
429
428
.MaxMemoryUsageBytes (1_MB)
430
429
.AppendTopics (GetTopicPath ())
431
430
.DecompressionExecutor (stepByStepExecutor)
@@ -511,7 +510,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileCompressionInFlight) {
511
510
std::cerr << " >>> TEST: gracefully closed" << std::endl;
512
511
}
513
512
514
- TEST_F (BasicUsage, SessionNotDestroyedWhileUserEventHandlingInFlight) {
513
+ TEST_F (BasicUsage, TEST_NAME( SessionNotDestroyedWhileUserEventHandlingInFlight) ) {
515
514
auto driver = MakeDriver ();
516
515
517
516
// controlled executor
@@ -542,7 +541,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileUserEventHandlingInFlight) {
542
541
543
542
// Create read session.
544
543
auto readSettings = TReadSessionSettings ()
545
- .ConsumerName (" test-consumer " )
544
+ .ConsumerName (GetConsumerName () )
546
545
.MaxMemoryUsageBytes (1_MB)
547
546
.AppendTopics (GetTopicPath ())
548
547
// .DirectRead(EnableDirectRead)
@@ -643,7 +642,7 @@ TEST_F(BasicUsage, SessionNotDestroyedWhileUserEventHandlingInFlight) {
643
642
std::cerr << " >>> TEST: gracefully closed" << std::endl;
644
643
}
645
644
646
- TEST_F (BasicUsage, ReadSessionCorrectClose) {
645
+ TEST_F (BasicUsage, TEST_NAME( ReadSessionCorrectClose) ) {
647
646
auto driver = MakeDriver ();
648
647
649
648
NPersQueue::TWriteSessionSettings writeSettings;
@@ -672,7 +671,7 @@ TEST_F(BasicUsage, ReadSessionCorrectClose) {
672
671
// Create read session.
673
672
NYdb::NTopic::TReadSessionSettings readSettings;
674
673
readSettings
675
- .ConsumerName (" test-consumer " )
674
+ .ConsumerName (GetConsumerName () )
676
675
.MaxMemoryUsageBytes (1_MB)
677
676
.Decompress (false )
678
677
.RetryPolicy (NYdb::NTopic::IRetryPolicy::GetNoRetryPolicy ())
@@ -700,7 +699,7 @@ TEST_F(BasicUsage, ReadSessionCorrectClose) {
700
699
std::this_thread::sleep_for (std::chrono::seconds (5 ));
701
700
}
702
701
703
- TEST_F (BasicUsage, ConfirmPartitionSessionWithCommitOffset) {
702
+ TEST_F (BasicUsage, TEST_NAME( ConfirmPartitionSessionWithCommitOffset) ) {
704
703
// TStartPartitionSessionEvent::Confirm(readOffset, commitOffset) should work,
705
704
// if commitOffset passed to Confirm is greater than the offset committed previously by the consumer.
706
705
// https://st.yandex-team.ru/KIKIMR-23015
@@ -723,7 +722,7 @@ TEST_F(BasicUsage, ConfirmPartitionSessionWithCommitOffset) {
723
722
{
724
723
// Read messages:
725
724
auto settings = NTopic::TReadSessionSettings ()
726
- .ConsumerName (" test-consumer " )
725
+ .ConsumerName (GetConsumerName () )
727
726
.AppendTopics (GetTopicPath ())
728
727
// .DirectRead(EnableDirectRead)
729
728
;
@@ -760,7 +759,7 @@ TEST_F(BasicUsage, ConfirmPartitionSessionWithCommitOffset) {
760
759
}
761
760
}
762
761
763
- TEST_F (BasicUsage, TWriteSession_WriteEncoded) {
762
+ TEST_F (BasicUsage, TEST_NAME( TWriteSession_WriteEncoded) ) {
764
763
// This test was adapted from ydb_persqueue tests.
765
764
// It writes 4 messages: 2 with default codec, 1 with explicitly set GZIP codec, 1 with RAW codec.
766
765
// 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) {
831
830
ASSERT_EQ (tokens, 2u );
832
831
833
832
auto readSettings = TReadSessionSettings ()
834
- .ConsumerName (" test-consumer " )
833
+ .ConsumerName (GetConsumerName () )
835
834
.AppendTopics (GetTopicPath ())
836
835
// .DirectRead(EnableDirectRead)
837
836
;
@@ -886,7 +885,7 @@ namespace {
886
885
887
886
class TSettingsValidation : public TTopicTestFixture {};
888
887
889
- TEST_F (TSettingsValidation, TestDifferentDedupParams) {
888
+ TEST_F (TSettingsValidation, TEST_NAME( TestDifferentDedupParams) ) {
890
889
char * ydbVersion = std::getenv (" YDB_VERSION" );
891
890
if (ydbVersion != nullptr && std::string (ydbVersion) != " trunk" && std::string (ydbVersion) < " 24.3" ) {
892
891
GTEST_SKIP () << " Skipping test for YDB version " << ydbVersion;
@@ -1003,13 +1002,13 @@ TEST_F(TSettingsValidation, TestDifferentDedupParams) {
1003
1002
runTest ({}, " msgGroup" , {}, false , EExpectedTestResult::SUCCESS);
1004
1003
}
1005
1004
1006
- TEST_F (TSettingsValidation, ValidateSettingsFailOnStart) {
1005
+ TEST_F (TSettingsValidation, TEST_NAME( ValidateSettingsFailOnStart) ) {
1007
1006
auto driver = MakeDriver ();
1008
1007
1009
1008
TTopicClient client (driver);
1010
1009
1011
1010
auto readSettings = TReadSessionSettings ()
1012
- .ConsumerName (" test-consumer " )
1011
+ .ConsumerName (GetConsumerName () )
1013
1012
.MaxMemoryUsageBytes (0 )
1014
1013
.AppendTopics (GetTopicPath ())
1015
1014
// .DirectRead(EnableDirectRead)
0 commit comments