@@ -800,6 +800,42 @@ Y_UNIT_TEST_SUITE(TopicAutoscaling) {
800
800
auto describe = client.DescribeTopic (TEST_TOPIC).GetValueSync ();
801
801
UNIT_ASSERT_EQUAL (describe.GetTopicDescription ().GetPartitions ().size (), 3 );
802
802
803
+ bool firstPartitionFound = false ;
804
+ for (const auto & partition : describe.GetTopicDescription ().GetPartitions ()) {
805
+ if (partition.GetPartitionId () == 0 ) {
806
+ firstPartitionFound = true ;
807
+ UNIT_ASSERT (!partition.GetActive ());
808
+ UNIT_ASSERT_EQUAL (partition.GetChildPartitionIds ().size (), 2 );
809
+ auto childIds = partition.GetChildPartitionIds ();
810
+ std::sort (childIds.begin (), childIds.end ());
811
+ UNIT_ASSERT_EQUAL (childIds[0 ], 1 );
812
+ UNIT_ASSERT_EQUAL (childIds[1 ], 2 );
813
+ }
814
+ }
815
+
816
+ UNIT_ASSERT (firstPartitionFound);
817
+
818
+ TString secondPartitionTo = " " ;
819
+ TString thirdPartitionFrom = " " ;
820
+ for (const auto & partition : describe.GetTopicDescription ().GetPartitions ()) {
821
+ if (partition.GetPartitionId () == 1 || partition.GetPartitionId () == 2 ) {
822
+ UNIT_ASSERT (partition.GetActive ());
823
+ if (partition.GetPartitionId () == 1 ) {
824
+ UNIT_ASSERT (partition.GetToBound ().Defined () && !partition.GetToBound ()->Empty ());
825
+ secondPartitionTo = *partition.GetToBound ();
826
+ }
827
+ if (partition.GetPartitionId () == 2 ) {
828
+ UNIT_ASSERT (partition.GetFromBound ().Defined () && !partition.GetFromBound ()->Empty ());
829
+ thirdPartitionFrom = *partition.GetFromBound ();
830
+ }
831
+ UNIT_ASSERT_EQUAL (partition.GetParentPartitionIds ().size (), 1 );
832
+ UNIT_ASSERT_EQUAL (partition.GetParentPartitionIds ()[0 ], 0 );
833
+ }
834
+ }
835
+
836
+ UNIT_ASSERT (!secondPartitionTo.Empty ());
837
+ UNIT_ASSERT (!thirdPartitionFrom.Empty ());
838
+
803
839
auto writeSession2 = CreateWriteSession (client, " producer-1" , 1 , TEST_TOPIC, false );
804
840
UNIT_ASSERT (writeSession2->Write (Msg (msg, 3 )));
805
841
UNIT_ASSERT (writeSession2->Write (Msg (msg, 4 )));
0 commit comments