masteryhx commented on code in PR #24488:
URL: https://github.com/apache/flink/pull/24488#discussion_r1522682796


##########
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/streaming/util/TestStreamEnvironment.java:
##########
@@ -124,33 +124,33 @@ private static void randomizeConfiguration(MiniCluster 
miniCluster, Configuratio
         }
 
         // randomize ITTests for enabling state change log
-        if 
(STATE_CHANGE_LOG_CONFIG.equalsIgnoreCase(STATE_CHANGE_LOG_CONFIG_ON)) {
-            if (!conf.contains(StateChangelogOptions.ENABLE_STATE_CHANGE_LOG)) 
{
+        if (!conf.contains(StateChangelogOptions.ENABLE_STATE_CHANGE_LOG)) {
+            if 
(STATE_CHANGE_LOG_CONFIG.equalsIgnoreCase(STATE_CHANGE_LOG_CONFIG_ON)) {
                 conf.set(StateChangelogOptions.ENABLE_STATE_CHANGE_LOG, true);
-                miniCluster.overrideRestoreModeForChangelogStateBackend();
-            }
-        } else if 
(STATE_CHANGE_LOG_CONFIG.equalsIgnoreCase(STATE_CHANGE_LOG_CONFIG_RAND)) {
-            boolean enabled =
-                    randomize(conf, 
StateChangelogOptions.ENABLE_STATE_CHANGE_LOG, true, false);
-            if (enabled) {
-                // More situations about enabling periodic materialization 
should be tested
-                randomize(
-                        conf,
-                        StateChangelogOptions.PERIODIC_MATERIALIZATION_ENABLED,
-                        true,
-                        true,
-                        true,
-                        false);
-                randomize(
-                        conf,
-                        
StateChangelogOptions.PERIODIC_MATERIALIZATION_INTERVAL,
-                        Duration.ofMillis(100),
-                        Duration.ofMillis(500),
-                        Duration.ofSeconds(1),
-                        Duration.ofSeconds(5));
-                miniCluster.overrideRestoreModeForChangelogStateBackend();
+            } else if 
(STATE_CHANGE_LOG_CONFIG.equalsIgnoreCase(STATE_CHANGE_LOG_CONFIG_RAND)) {
+                randomize(conf, StateChangelogOptions.ENABLE_STATE_CHANGE_LOG, 
true, false);
             }
         }
+
+        // randomize periodic materialization when enabling state change log
+        if (conf.get(StateChangelogOptions.ENABLE_STATE_CHANGE_LOG)) {

Review Comment:
   Thanks for your suggestion.
   I have also applied to 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: [email protected]

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

Reply via email to