@@ -217,42 +217,40 @@ func TriggerElementCount(s beam.Scope) {
217217 }, 2 )
218218}
219219
220- // TriggerAfterProcessingTime tests the AfterProcessingTime Trigger, it fires output panes once 't' processing time has passed
220+ // TriggerAfterProcessingTimeNotTriggered tests the AfterProcessingTime Trigger. It won't fire because 't' processing time is not reached
221221// Not yet supported by the flink runner:
222222// java.lang.UnsupportedOperationException: Advancing Processing time is not supported by the Flink Runner.
223- func TriggerAfterProcessingTime (s beam.Scope ) {
223+ func TriggerAfterProcessingTimeNotTriggered (s beam.Scope ) {
224224 con := teststream .NewConfig ()
225225 con .AdvanceProcessingTime (100 )
226226 con .AddElements (1000 , 1.0 , 2.0 , 3.0 )
227- con .AdvanceWatermark (1000 ) // must advance watermark so that elements are processed in the downstream stages
228- con .AdvanceProcessingTime (5000 ) // advance processing time to fire the trigger
229- con .AddElements (2000 , 4.0 )
230- con .AdvanceWatermark (2000 )
227+ con .AdvanceProcessingTime (4999 ) // advance processing time but not enough to fire the trigger
228+ con .AddElements (22000 , 4.0 )
229+
231230 col := teststream .Create (s , con )
232231
233232 validateEquals (s .Scope ("Global" ), window .NewGlobalWindows (), col ,
234233 []beam.WindowIntoOption {
235234 beam .Trigger (trigger .AfterProcessingTime ().PlusDelay (5 * time .Second )),
236- }, 6.0 , 4 .0 )
235+ }, 10 .0 )
237236}
238237
239- // TriggerAfterProcessingTime tests the AfterProcessingTime Trigger, it fires output panes once 't' processing time has passed
238+ // TriggerAfterProcessingTime tests the AfterProcessingTime Trigger. It fires output panes once 't' processing time has passed
240239// Not yet supported by the flink runner:
241240// java.lang.UnsupportedOperationException: Advancing Processing time is not supported by the Flink Runner.
242- func TriggerAfterProcessingTimeNotTriggered (s beam.Scope ) {
241+ func TriggerAfterProcessingTime (s beam.Scope ) {
243242 con := teststream .NewConfig ()
244243 con .AdvanceProcessingTime (100 )
245244 con .AddElements (1000 , 1.0 , 2.0 , 3.0 )
246- con .AdvanceWatermark (1000 ) // must advance watermark so that elements are processed in the downstream stages
247- con .AdvanceProcessingTime (4999 ) // advance processing time but not enough to fire the trigger
248- con .AddElements (2000 , 4.0 )
249- con .AdvanceWatermark (2000 )
245+ con .AdvanceProcessingTime (5000 ) // advance processing time to fire the trigger
246+ con .AddElements (22000 , 4.0 )
247+
250248 col := teststream .Create (s , con )
251249
252250 validateEquals (s .Scope ("Global" ), window .NewGlobalWindows (), col ,
253251 []beam.WindowIntoOption {
254252 beam .Trigger (trigger .AfterProcessingTime ().PlusDelay (5 * time .Second )),
255- }, 10 .0 )
253+ }, 6.0 , 4 .0 )
256254}
257255
258256// TriggerRepeat tests the repeat trigger. As of now is it is configure to take only one trigger as a subtrigger.
0 commit comments