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-unsubscr...@kafka.apache.org

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

Reply via email to