13
13
import org .junit .BeforeClass ;
14
14
import org .junit .ClassRule ;
15
15
import org .junit .FixMethodOrder ;
16
- import org .junit .Ignore ;
17
16
import org .junit .Test ;
18
17
import org .junit .runners .MethodSorters ;
19
18
import org .slf4j .Logger ;
@@ -55,6 +54,8 @@ public class YdbTopicsIntegrationTest {
55
54
public final static GrpcTransportRule ydbTransport = new GrpcTransportRule ();
56
55
57
56
private final static String TEST_TOPIC = "integration_test_topic" ;
57
+ private final static String TEST_OTHER_TOPIC = "integration_test_other_topic" ;
58
+
58
59
private final static String TEST_CONSUMER1 = "consumer" ;
59
60
private final static String TEST_CONSUMER2 = "other_consumer" ;
60
61
@@ -244,12 +245,13 @@ public void onMessages(DataReceivedEvent dre) {
244
245
}
245
246
}
246
247
247
- @ Ignore ("remove ignore once :latest YDB container tag moves onto version 25.1" )
248
248
@ Test
249
249
public void step07_alterTopicWithAutoPartitioning () {
250
250
client .alterTopic (TEST_TOPIC , AlterTopicSettings .newBuilder ()
251
251
.setAlterPartitioningSettings (AlterPartitioningSettings .newBuilder ()
252
252
.setAutoPartitioningStrategy (AutoPartitioningStrategy .SCALE_UP )
253
+ .setMaxActivePartitions (10 )
254
+ .setMinActivePartitions (5 )
253
255
.setWriteStrategySettings (AlterAutoPartitioningWriteStrategySettings .newBuilder ()
254
256
.setStabilizationWindow (Duration .ofMinutes (1 ))
255
257
.setUpUtilizationPercent (80 )
@@ -267,10 +269,34 @@ public void step07_alterTopicWithAutoPartitioning() {
267
269
.setUpUtilizationPercent (80 )
268
270
.setDownUtilizationPercent (20 )
269
271
.build ())
270
- .setMinActivePartitions (1 )
271
- .setMaxActivePartitions (1 )
272
+ .setMinActivePartitions (5 )
273
+ .setMaxActivePartitions (10 )
272
274
.build ();
273
275
274
276
Assert .assertEquals (expectedPartitioningSettings , actualPartitioningSettings );
275
277
}
278
+
279
+ @ Test
280
+ public void step08_createTopicWithAutoPartitioning () {
281
+ PartitioningSettings expectedPartitioningSettings = PartitioningSettings .newBuilder ()
282
+ .setMaxActivePartitions (8 )
283
+ .setMinActivePartitions (4 )
284
+ .setAutoPartitioningStrategy (AutoPartitioningStrategy .SCALE_UP )
285
+ .setWriteStrategySettings (AutoPartitioningWriteStrategySettings .newBuilder ()
286
+ .setDownUtilizationPercent (5 )
287
+ .setUpUtilizationPercent (75 )
288
+ .setStabilizationWindow (Duration .ofMinutes (2 ))
289
+ .build ())
290
+ .build ();
291
+
292
+ CompletableFuture <Status > secondaryTopicCreated = client .createTopic (TEST_OTHER_TOPIC , CreateTopicSettings .newBuilder ()
293
+ .setPartitioningSettings (expectedPartitioningSettings )
294
+ .build ());
295
+
296
+ secondaryTopicCreated .join ().expectSuccess ("can't create the topic" );
297
+
298
+ TopicDescription description = client .describeTopic (TEST_OTHER_TOPIC ).join ().getValue ();
299
+
300
+ Assert .assertEquals (expectedPartitioningSettings , description .getPartitioningSettings ());
301
+ }
276
302
}
0 commit comments