You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "alok123t (via GitHub)" <gi...@apache.org> on 2023/11/01 14:33:37 UTC

[PR] Add junit properties to display parameterized test names [kafka]

alok123t opened a new pull request, #14687:
URL: https://github.com/apache/kafka/pull/14687

   In many parameterized tests, the display name is broken. Example - `testMetadataFetch` appears as `[1] true`, `[2] false`  [link](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14607/9/testReport/junit/org.apache.kafka.clients.producer/KafkaProducerTest/) 
   This is because the constant in `@ParameterizedTest`
   ```java
   String DEFAULT_DISPLAY_NAME = "[{index}] {argumentsWithNames}";
   ```
   
   This PR adds a new `junit-platform.properties` which overrides to add a `{displayName}` which shows the `the display name of the method`
   
   For existing tests which override the name, should work as is. The precedence rules are explained
   
   > 1. `name` attribute in `@ParameterizedTest`, if present
   > 2. value of the `junit.jupiter.params.displayname.default` configuration parameter, if present
   > 3. `DEFAULT_DISPLAY_NAME` constant defined in `@ParameterizedTest`
   
   Source: https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests-display-names
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "alok123t (via GitHub)" <gi...@apache.org>.
alok123t commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1792000985

   Thanks for the context on JUnit4, once the build completes. Looks like streams/connect today use this, example [ConsistencyVectorIntegrationTest](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14687/1/testReport/junit/org.apache.kafka.streams.integration/ConsistencyVectorIntegrationTest/). 
   I'll check the CI output if we see any discrepancies before/after


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "alok123t (via GitHub)" <gi...@apache.org>.
alok123t commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1812467554

   @divijvaidya looks unrelated. Most failed tests are related to `RestoreIntegrationTest` - likely some regression when I merged in latest changes from trunk to trigger a new build


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac merged PR #14687:
URL: https://github.com/apache/kafka/pull/14687


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "alok123t (via GitHub)" <gi...@apache.org>.
alok123t commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1827838896

   > Hey @alok123t. Thanks for working on this. In the last build, I just noticed that parameterized still are still reported as:
   > 
   > ```
   > Build / JDK 21 and Scala 2.13 / [5] Type=ZK, MetadataVersion=3.7-IV1, Security=PLAINTEXT – kafka.zk.ZkMigrationIntegrationTest
   > ```
   > 
   > Shouldn't your patch fix those as well?
   
   @dajac Looks like these tests are based on the `@ClusterTest` annotation which internally overrides the `name()` https://github.com/apache/kafka/blob/af747fbfed7e81617c3b3ad0e4dc8c857aa9502b/core/src/test/java/kafka/test/annotation/ClusterTest.java#L41 and has it own custom implementation of overriding the name https://github.com/apache/kafka/blob/9b468fb278701be836a2641650356907bf84860a/core/src/test/java/kafka/test/junit/ClusterTestExtensions.java#L187
   In case there are no other outstanding comments, shall we go ahead and merge this PR and we can fix the naming for the ones which use annotations in a subsequent PR
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "cadonna (via GitHub)" <gi...@apache.org>.
cadonna commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1415253303


##########
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java:
##########
@@ -239,10 +240,14 @@ public static String safeUniqueTestName(final Class<?> testClass, final TestName
      * Used by tests migrated to JUnit 5.
      */
     public static String safeUniqueTestName(final Class<?> testClass, final TestInfo testInfo) {
-        final String displayName = testInfo.getDisplayName();
         final String methodName = testInfo.getTestMethod().map(Method::getName).orElse("unknownMethodName");
-        final String testName = displayName.contains(methodName) ? methodName : methodName + displayName;
-        return safeUniqueTestName(testClass, testName);
+        // Generate a random uuid without an `-`. The `-` is used in Streams' thread name as
+        // a separator and some tests rely on this.
+        String randomUuid;
+        do {
+            randomUuid = Uuid.randomUuid().toString();
+        } while (randomUuid.contains("-"));

Review Comment:
   I think we can use whatever we want, also `_`. There is an override of `safeUniqueTestName()` that does a similar replacement. I think you could add there `-`. It just seemed costly and somehow overly complicated to me to re-generate a random sequence just to get rid of a character. But probably it is not costly because in most cases we only need to re-generate once.     



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1808020892

   I triggered a re-build of the CI since JDK11+Scala 2.13 was failing


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1415122463


##########
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java:
##########
@@ -239,10 +240,14 @@ public static String safeUniqueTestName(final Class<?> testClass, final TestName
      * Used by tests migrated to JUnit 5.
      */
     public static String safeUniqueTestName(final Class<?> testClass, final TestInfo testInfo) {
-        final String displayName = testInfo.getDisplayName();
         final String methodName = testInfo.getTestMethod().map(Method::getName).orElse("unknownMethodName");
-        final String testName = displayName.contains(methodName) ? methodName : methodName + displayName;
-        return safeUniqueTestName(testClass, testName);
+        // Generate a random uuid without an `-`. The `-` is used in Streams' thread name as
+        // a separator and some tests rely on this.
+        String randomUuid;
+        do {
+            randomUuid = Uuid.randomUuid().toString();
+        } while (randomUuid.contains("-"));

Review Comment:
   Yeah, I considered this as well. The question is which one should we use? We could use `_` but then the uuid looks a bit weird when you get one with `_` in the middle. I thought that it is ok to re-generate a new one in this case. I can change it if you prefer.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1827911402

   Thanks for the explanation, @alok123t! I think that we could fix those separately, if we want to. @divijvaidya Do you want to do a final review?


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1794443451

   @alok123t Let me know when this is ready for review. And yes, let's just add this proactively to all modules OR, is it possible to put it at one place and apply for all modules (in build.gradle you will notice things such as rat are configured once and get applied for all modules)? Perhaps something worth considering.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1410811193


##########
streams/src/test/java/org/apache/kafka/streams/integration/HighAvailabilityTaskAssignorIntegrationTest.java:
##########
@@ -137,8 +138,8 @@ private void shouldScaleOutWithWarmupTasks(final Function<String, Materialized<O
             new TopicPartition(inputTopic, 1)
         );
 
-        final String storeName = "store" + testId;
-        final String storeChangelog = appId + "-store-changelog";
+        final String storeName = "store_" + Uuid.randomUuid().toString();

Review Comment:
   This change is actually not needed anymore with the last version of `safeUniqueTestName`. Let me remove it. But to answer your question, the topic name derived from the store name was too long because the testId was included twice.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1408976485


##########
streams/src/test/java/org/apache/kafka/streams/integration/HighAvailabilityTaskAssignorIntegrationTest.java:
##########
@@ -138,7 +138,7 @@ private void shouldScaleOutWithWarmupTasks(final Function<String, Materialized<O
         );
 
         final String storeName = "store" + testId;
-        final String storeChangelog = appId + "-store" + testId + "-changelog";
+        final String storeChangelog = appId + "-store-changelog";

Review Comment:
   The name got too long (above the max for a topic name) with the changes in this PR. As the `appId` already contains the `testId`, it seems that we could just remove it.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1834494230

   I cannot get a clean build for this one...


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "cadonna (via GitHub)" <gi...@apache.org>.
cadonna commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1410730716


##########
streams/src/test/java/org/apache/kafka/streams/integration/HighAvailabilityTaskAssignorIntegrationTest.java:
##########
@@ -137,8 +138,8 @@ private void shouldScaleOutWithWarmupTasks(final Function<String, Materialized<O
             new TopicPartition(inputTopic, 1)
         );
 
-        final String storeName = "store" + testId;
-        final String storeChangelog = appId + "-store-changelog";
+        final String storeName = "store_" + Uuid.randomUuid().toString();

Review Comment:
   Why does `testId` not work here?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "alok123t (via GitHub)" <gi...@apache.org>.
alok123t commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1805185143

   @divijvaidya I think it looks reasonable JUnit 4 test - [ConsistencyVectorIntegrationTest](
   https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14687/5/testReport/junit/org.apache.kafka.streams.integration/ConsistencyVectorIntegrationTest/) running on CI


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "alok123t (via GitHub)" <gi...@apache.org>.
alok123t commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1794910231

   @divijvaidya looks like we only need add the junit file in root modules like `server-common` and `clients` and other should be able to import 


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1827493259

   @alok123t Any progress on this one? I actually need it to continue my [experiment](https://github.com/apache/kafka/pull/14743) to improve our CI.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1812491676

   Hey @alok123t. Thanks for working on this. In the last build, I just noticed that parameterized still are still reported as:
   ```
   Build / JDK 21 and Scala 2.13 / [5] Type=ZK, MetadataVersion=3.7-IV1, Security=PLAINTEXT – kafka.zk.ZkMigrationIntegrationTest
   ```
   Shouldn't your patch fix those as well?


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "alok123t (via GitHub)" <gi...@apache.org>.
alok123t commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1791997526

   @divijvaidya added in modules, where `ParameterizedTest` is currently used as part of https://github.com/apache/kafka/pull/14687/commits/777d14d3aba7c59070916497388d82adeb19405a. We could also just do it in all modules as well, let me know if that's useful


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1795080507

   > @divijvaidya looks like we only need add the junit file in root modules like `server-common` and `clients` and other should be able to import
   
   Sweet! Please verify after the CI is complete that we don't have regression with tests which use Junit 4 and then we should be ready to merge.
   
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1790354592

   This is a great change but note that we don't use JUnit5 for all tests. Hence we need to ensure that this change doesn't impact Junit4 tests. Ref:
   https://github.com/apache/kafka/blob/9911fab1a1a95b7783c21fef75f043ea42fea790/build.gradle#L470 
   
   
   Also, can we do it for all tests in Kafka instead of just for the clients module? 


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1408975349


##########
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java:
##########
@@ -239,10 +240,8 @@ public static String safeUniqueTestName(final Class<?> testClass, final TestName
      * Used by tests migrated to JUnit 5.
      */
     public static String safeUniqueTestName(final Class<?> testClass, final TestInfo testInfo) {
-        final String displayName = testInfo.getDisplayName();
         final String methodName = testInfo.getTestMethod().map(Method::getName).orElse("unknownMethodName");
-        final String testName = displayName.contains(methodName) ? methodName : methodName + displayName;
-        return safeUniqueTestName(testClass, testName);
+        return safeUniqueTestName(testClass, methodName + "_" + Uuid.randomUuid().toString());

Review Comment:
   With the current method, we end up with a non-unique name for the parameterized tests. Therefore, I suggest to just use the name of the method with a uuid.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1830424668

   We need to investigate the failed tests before we can merge this one.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "cadonna (via GitHub)" <gi...@apache.org>.
cadonna commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1412039372


##########
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java:
##########
@@ -239,10 +240,14 @@ public static String safeUniqueTestName(final Class<?> testClass, final TestName
      * Used by tests migrated to JUnit 5.
      */
     public static String safeUniqueTestName(final Class<?> testClass, final TestInfo testInfo) {
-        final String displayName = testInfo.getDisplayName();
         final String methodName = testInfo.getTestMethod().map(Method::getName).orElse("unknownMethodName");
-        final String testName = displayName.contains(methodName) ? methodName : methodName + displayName;
-        return safeUniqueTestName(testClass, testName);
+        // Generate a random uuid without an `-`. The `-` is used in Streams' thread name as
+        // a separator and some tests rely on this.
+        String randomUuid;
+        do {
+            randomUuid = Uuid.randomUuid().toString();
+        } while (randomUuid.contains("-"));

Review Comment:
   Why not just replacing `-` with a different character? 



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add junit properties to display parameterized test names [kafka]

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #14687:
URL: https://github.com/apache/kafka/pull/14687#issuecomment-1812459578

   We have an unusually large number of failures. @alok123t can you please check the failures to see if they might be related to this change?


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Add junit properties to display parameterized test names [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14687:
URL: https://github.com/apache/kafka/pull/14687#discussion_r1415612525


##########
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java:
##########
@@ -239,10 +240,14 @@ public static String safeUniqueTestName(final Class<?> testClass, final TestName
      * Used by tests migrated to JUnit 5.
      */
     public static String safeUniqueTestName(final Class<?> testClass, final TestInfo testInfo) {
-        final String displayName = testInfo.getDisplayName();
         final String methodName = testInfo.getTestMethod().map(Method::getName).orElse("unknownMethodName");
-        final String testName = displayName.contains(methodName) ? methodName : methodName + displayName;
-        return safeUniqueTestName(testClass, testName);
+        // Generate a random uuid without an `-`. The `-` is used in Streams' thread name as
+        // a separator and some tests rely on this.
+        String randomUuid;
+        do {
+            randomUuid = Uuid.randomUuid().toString();
+        } while (randomUuid.contains("-"));

Review Comment:
   Addressed with the last commit.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org