Varka808 commented on code in PR #27509:
URL: https://github.com/apache/flink/pull/27509#discussion_r2985274423


##########
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/RestHandlerConfigurationTest.java:
##########
@@ -142,4 +143,64 @@ void testCheckpointCacheSize() {
                 RestHandlerConfiguration.fromConfiguration(config);
         
assertThat(restHandlerConfiguration.getCheckpointCacheSize()).isEqualTo(testCacheSize);
     }
+
+    /** Tests that ExecutionGraph cache TTL defaults to refresh interval when 
not set. */
+    @Test
+    void testExecutionGraphCacheTTLDefault() {
+        final Duration refreshInterval = Duration.ofMillis(5000L);
+        final Configuration config = new Configuration();
+        config.set(WebOptions.REFRESH_INTERVAL, refreshInterval);
+
+        RestHandlerConfiguration restHandlerConfiguration =
+                RestHandlerConfiguration.fromConfiguration(config);
+
+        // When CACHE_EXECUTION_GRAPH_TIMEOUT is not set, it should default to 
REFRESH_INTERVAL
+        
assertThat(restHandlerConfiguration.getExecutionGraphCacheTTL()).isEqualTo(refreshInterval);
+    }
+
+    /** Tests that ExecutionGraph cache TTL can be configured independently. */
+    @Test
+    void testExecutionGraphCacheTTLCustomValue() {
+        final Duration refreshInterval = Duration.ofMillis(5000L);
+        final Duration cacheTTL = Duration.ofMillis(10000L);
+        final Configuration config = new Configuration();
+        config.set(WebOptions.REFRESH_INTERVAL, refreshInterval);
+        config.set(RestOptions.CACHE_EXECUTION_GRAPH_TIMEOUT, cacheTTL);
+
+        RestHandlerConfiguration restHandlerConfiguration =
+                RestHandlerConfiguration.fromConfiguration(config);
+
+        // EXECUTION_GRAPH_CACHE_TTL should be independent of REFRESH_INTERVAL
+        assertThat(restHandlerConfiguration.getRefreshInterval())
+                .isEqualTo(refreshInterval.toMillis());
+        
assertThat(restHandlerConfiguration.getExecutionGraphCacheTTL()).isEqualTo(cacheTTL);
+    }
+
+    /**
+     * Tests that ExecutionGraph cache TTL can be set to zero for real-time 
state synchronization.
+     */
+    @Test
+    void testExecutionGraphCacheTTLZeroValue() {

Review Comment:
   This `zero value` test can be merged into 
`testExecutionGraphCacheTTLCustomValue`.



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