Matthias Pohl created FLINK-29956:
-------------------------------------
Summary: Kafka-related test infrastructure code is scattered over
multiple classes/environments
Key: FLINK-29956
URL: https://issues.apache.org/jira/browse/FLINK-29956
Project: Flink
Issue Type: Improvement
Components: Connectors / Kafka
Affects Versions: 1.17.0
Reporter: Matthias Pohl
We had a few issues with the test stability of Kafka-related tests
(FLINK-24119, FLINK-29914). A workaround was to add randomness to topic
identifiers. This change required touching multiple code locations that made it
obvious that there is some room for improvement (see [Gabor's
comment|https://github.com/apache/flink/pull/21247#issuecomment-1307084416]
comment in the related PR). We could put some effort into unifying this by
providing a common test environment that provides utility methods he mentioned
in his comment:
{quote}
Topic creation
Topic deletion
Random name generation
AdminClient creation
Consumer creation
Producer creation
{quote}
Currently, we have Kafka instances created in different locations in our test
suite (e.g. {{KafkaSourceTestEnv}}, {{KafkaTestEnvironmentImpl}},
{{KafkaTableTestBase}}). One idea is to provide a JUnit5 extension for this
similarly to what we do with the
[MiniClusterExtension|https://github.com/apache/flink/blob/a6db6ee5d0d6e9b50c6d110793e2efbd0d57cc38/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/junit5/MiniClusterExtension.java]
for Flink. Maybe, there's already something out there that can be
used/extended.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)