fhueske commented on code in PR #27935:
URL: https://github.com/apache/flink/pull/27935#discussion_r3093856128


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionTestUtils.java:
##########
@@ -664,7 +667,12 @@ public static class OptionalOnTimeFunction extends 
AppendProcessTableFunctionBas
         public void eval(Context ctx, @ArgumentHint(SET_SEMANTIC_TABLE) Row r) 
{
             final TimeContext<Long> timeCtx = ctx.timeContext(Long.class);
             collectEvalEvent(timeCtx, r);
-            collectCreateTimer(timeCtx, "t", 2);
+            Long wm = timeCtx.currentWatermark();
+            // Register at wm+1 to always target the immediate next watermark: 
the timer fires
+            // exactly once per watermark advance, and each new row 
re-registers the timer for the
+            // following watermark step, demonstrating repeated timer 
re-registration.
+            long timer = wm == null || wm < 0 ? 1 : wm + 1;

Review Comment:
   This is just a function for testing purposes and we assert against the 
behavior that we implement. 
   So I think it doesn't really matter.
   Or is there an (edge) case that would be covered with your suggestion that 
isn't with the current version?



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