Jiayi-Liao commented on pull request #16744:
URL: https://github.com/apache/flink/pull/16744#issuecomment-895030964


   > @Jiayi-Liao , let me repeat my question if I understand the problem 
correctly:
   > 
   > > This is basically the same bug as 
https://issues.apache.org/jira/browse/FLINK-9857 but this time in test code?
   > 
   > That the `TestProcessingTimeService` is firing the timers 1ms too soon, 
but unfortunately a lot of tests depend on that behaviour? If so, I would 
prefer to fix it, as that would be simply a bug in tests that can come and bite 
us in the future anyway?
   > 
   > I see that it requires a lot of modifications, but have you tried to 
automise it? If you are using IntelliJ (or some other clever IDE) this trick 
might work:
   > 
   > 1. create a temporary method that will increase `time + 1`:
   > 
   > ```
   >     public void setProcessingTime(long time) throws Exception {
   >         setProcessingTimeV2(time + 1);
   >     }
   > 
   >     public void setProcessingTimeV2(long time) throws Exception {
   >         processingTimeService.setCurrentTime(time);
   >     }
   > ```
   > 
   > 1. Fix a couple of tests that were passing `MAX_VALUE`
   > 2. Inline `setProcessingTime(time)`
   > 3. Rename `setProcessingTimeV2(time)` back to `setProcessingTime(time)`
   > 
   > ?
   > 
   > Btw, if this change is really that big, then having a separate ticket for 
it would be a bit better.
   
   @pnowojski  Yes. I've tried your way before, but the real situation is very 
complex and this way can only fix part of the failed tests. In most tests which 
are invoking `setCurrentTime(long)` for several times, the fix doesn't work. 
(e.g. StreamSourceOperatorWatermarksTest.java)
   
   


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to