dawidwys commented on a change in pull request #17581:
URL: https://github.com/apache/flink/pull/17581#discussion_r748310871



##########
File path: 
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/streaming/util/TestStreamEnvironment.java
##########
@@ -87,43 +85,44 @@ public static void setAsContext(
                             new TestStreamEnvironment(
                                     miniCluster, parallelism, jarFiles, 
classpaths);
 
-                    // randomize ITTests for enabling unaligned checkpoint
-                    if (RANDOMIZE_CHECKPOINTING_CONFIG) {
-                        randomize(
-                                conf, 
ExecutionCheckpointingOptions.ENABLE_UNALIGNED, true, false);
-                        randomize(
-                                conf,
-                                
ExecutionCheckpointingOptions.ALIGNMENT_TIMEOUT,
-                                Duration.ofSeconds(0),
-                                Duration.ofMillis(100),
-                                Duration.ofSeconds(2));
-                    }
-
-                    // randomize ITTests for enabling state change log
-                    if 
(isConfigurationSupportedByChangelog(miniCluster.getConfiguration())) {
-                        if 
(STATE_CHANGE_LOG_CONFIG.equalsIgnoreCase(STATE_CHANGE_LOG_CONFIG_ON)) {
-                            
conf.set(StateChangelogOptions.ENABLE_STATE_CHANGE_LOG, true);
-                        } else if (STATE_CHANGE_LOG_CONFIG.equalsIgnoreCase(
-                                STATE_CHANGE_LOG_CONFIG_RAND)) {
-                            randomize(
-                                    conf,
-                                    
StateChangelogOptions.ENABLE_STATE_CHANGE_LOG,
-                                    true,
-                                    false);
-                        }
-                    }
-
-                    // randomize ITTests for enabling buffer de-bloating
-                    if (RANDOMIZE_BUFFER_DEBLOAT_CONFIG) {
-                        randomize(conf, 
TaskManagerOptions.BUFFER_DEBLOAT_ENABLED, true, false);
-                    }
+                    randomizeConfiguration(miniCluster, conf);
+
                     env.configure(conf, env.getUserClassloader());
                     return env;
                 };
 
         initializeContextEnvironment(factory);
     }
 
+    /**
+     * This is the place for randomization the configuration that relates to 
DataStream API such as
+     * ExecutionConf, CheckpointConf, StreamExecutionEnvironment. List of the 
configurations can be
+     * found here {@link StreamExecutionEnvironment#configure(ReadableConfig, 
ClassLoader)}. All
+     * other configuration should be randomized here {@link
+     * 
org.apache.flink.runtime.testutils.MiniClusterResource#randomizeConfiguration(Configuration)}.
+     */
+    private static void randomizeConfiguration(MiniCluster miniCluster, 
Configuration conf) {

Review comment:
       Thanks for the comments! I think they will be helpful for people who get 
to this point in the future!




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


Reply via email to