You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Jiayi Liao (Jira)" <ji...@apache.org> on 2021/08/09 12:08:00 UTC
[jira] [Created] (FLINK-23689)
TestProcessingTimeService.setCurrentTime(long) not delay the firing timer
by 1ms delay
Jiayi Liao created FLINK-23689:
----------------------------------
Summary: TestProcessingTimeService.setCurrentTime(long) not delay the firing timer by 1ms delay
Key: FLINK-23689
URL: https://issues.apache.org/jira/browse/FLINK-23689
Project: Flink
Issue Type: Improvement
Components: Runtime / Task, Tests
Affects Versions: 1.13.2, 1.12.4, 1.11.4, 1.14.0
Reporter: Jiayi Liao
FLINK-9857 enabled {{SystemProcessingTimeService}} to fire processing timers by 1ms delay but it ignored {{TestProcessingTimeService}}, and the method {{TestProcessingTimeService.setCurrentTime}} can still trigger the processing timers whose timestamp is equal to {{currentTime}}.
{code:java}
while (!priorityQueue.isEmpty() && currentTime >= priorityQueue.peek().f0) {
..
}
{code}
We can simply fix the problem with {{currentTime > priorityQueue.peek().f0}}, but it will break too many existing tests:
* Tests using {{TestProcessingTimeService.setCurrentTime(long)}} (64 usage)
* Tests using {{AbstractStreamOperatorTestHarness.setProcessingTime(long)}} (368 usage)
Tips: Some tests can be fixed with plusing 1ms on the parameter of {{TestProcessingTimeService.setCurrentTime(long)}}, but this doesn't work in tests that invokes {{setCurrentTime(long)}} for serveral times.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)