XComp commented on code in PR #21247:
URL: https://github.com/apache/flink/pull/21247#discussion_r1017969434
##########
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaConsumerTestBase.java:
##########
@@ -1238,7 +1238,7 @@ public void runProduceConsumeMultipleTopics(boolean
useLegacySchema) throws Exce
// create topics with content
final List<String> topics = new ArrayList<>();
for (int i = 0; i < numTopics; i++) {
- final String topic = topicNamePrefix + i;
+ final String topic = topicNamePrefix + i + UUID.randomUUID();
Review Comment:
I noticed that we have also other occurrences where we're not adding the
UUID to the topic (I didn't check that in my first pass). Is there a specific
reason why we only select certain topics? Alternatively, we could add the
randomization of topics to
[KafkaTestBase.createTestTopic](https://github.com/apache/flink/blob/44f73c496ed1514ea453615b77bee0486b8998db/flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaTestBase.java#L215)
and
[KafkaTableTestBase#createTestTopic](https://github.com/apache/flink/blob/ca9fea2459f7e066eac0fb59b382e58c41e0d702/flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/KafkaTableTestBase.java#L132).
We would have to change the methods' signatures to return the randomized topic
String (we should rename the method name in that case as well) which will then
be used in the corresponding tests:
```
// old method signature:
public void createTestTopic(String topic, int numPartitions, int
replicationFactor) {
// ...
// new method signature:
public String createRandomizedTestTopic(String topicPrefix, int
numPartitions, int replicationFactor) {
```
WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]