AHeise commented on a change in pull request #13551:
URL: https://github.com/apache/flink/pull/13551#discussion_r557266156



##########
File path: 
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/streaming/util/TestStreamEnvironment.java
##########
@@ -69,13 +74,28 @@ public static void setAsContext(
                     TestStreamEnvironment env =
                             new TestStreamEnvironment(
                                     miniCluster, parallelism, jarFiles, 
classpaths);
+                    randomize(conf);
                     env.configure(conf, env.getUserClassloader());
                     return env;
                 };
 
         initializeContextEnvironment(factory);
     }
 
+    /**
+     * Randomizes configuration on test case level even if mini cluster is 
used in a class rule.
+     *
+     * @param conf
+     */
+    private static void randomize(Configuration conf) {
+        if (Randomization) {
+            final String testName = TestNameProvider.getCurrentTestName();

Review comment:
       To make it independent of `TestLogger` we could use 
[RunListener](https://junit.org/junit4/javadoc/4.12/org/junit/runner/notification/RunListener.html)
 and then have a singleton listener to fetch the name.
   However, I didn't go fully into this direction as it's quite a bit of 
fiddling in junit4 and I hope to eventually migrate to junit 5. Then I'd check 
if it can be done in a better way.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to