[ 
https://issues.apache.org/jira/browse/BEAM-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15534161#comment-15534161
 ] 

Ben Chambers commented on BEAM-694:
-----------------------------------

I think this is partly intentional with the newer formulation of Triggers and 
how they interact with timers (eg., the Triggers as predicates). Specifically, 
Triggers no longer "receive" timers. Instead, a timer is just an indication 
that the trigger would like to be re-evaluated at some point in time. So, what 
we should probably do is:

1. Test that triggers *set* reasonable timers (this ensures they get woken up 
at reasonable points in time)
2. Separately test that triggers behave correctly when they are woken up (via a 
call to `shouldFire`).

It is important to actually do these separately, since `shouldFire` may be 
called for other reasons as well (such as when the watermark is passing the end 
of the window). There may be no timer from the trigger, but it may still get a 
chance to trigger or not.

If I understand the problem, it is that we're missing the tests for 1. I don't 
think we should necessarily tie the two together in the tests since they are 
not coupled in the actual implementation.

> TriggerTester doesn't test timer firings
> ----------------------------------------
>
>                 Key: BEAM-694
>                 URL: https://issues.apache.org/jira/browse/BEAM-694
>             Project: Beam
>          Issue Type: Bug
>            Reporter: Eugene Kirpichov
>
> TriggerTester exposes a `fireIfShouldFire(BoundedWIndow)` method. This is 
> used to prompt a call to the trigger with the current state of the trigger 
> tester (Input Watermarks, elements present, etc), and see if the trigger 
> should fire.
> The TriggerTester should automatically call back to the trigger with the 
> current state whenever a Timer fires, as specified by the current watermarks 
> and any Timers set by the trigger under test. This ensures that Triggers set 
> underlying timers properly, so the trigger will fire even if no additional 
> elements arrive.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to