HuangXingBo commented on PR #24387:
URL: https://github.com/apache/flink/pull/24387#issuecomment-1971427877

   @1996fanrui The test failed is actually related to the implementation of 
`Duration`. Now, `Duration` is a wrapper for the java class in the JVM created 
by `gateway`. If `Duration` is used as a default parameter, it will advance the 
time of the JVM created by `gateway` used in `Duration`. The crux of the 
problem is that some test environment variables set in `TestBase` and the 
effect of jar packages added by dependent test environment variables would not 
be effective anymore. This results in the launched gateway not loading many 
flink test jars, so we will find that the test class is not found (there won't 
be a problem in the production code, it only affects the test because we add 
some test jars to the classpath in testing). The perfect solution is to change 
the Duration implementation, making Duration usable as a default parameter 
without affecting test passing. But this change would be significant, every 
part that uses `Duration` needs considering. In the short term, I believe w
 e just need to remove Duration as the default parameter, represent the default 
parameter with None, then check in the method if the parameter is `None` or 
not, similar to the implementation below.
   ```
   def cleanup_in_rocksdb_compact_filter(
           self,
           query_time_after_num_entries,
           periodic_compaction_time=Duration.of_days(30)) -> \
           'StateTtlConfig.Builder':
       self._strategies[
        StateTtlConfig.CleanupStrategies.Strategies.ROCKSDB_COMPACTION_FILTER] 
= \
        StateTtlConfig.CleanupStrategies.RocksdbCompactFilterCleanupStrategy(
                query_time_after_num_entries,
                periodic_compaction_time if periodic_compaction_time else 
Duration.of_days(30))
       return self
   ```


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