[
https://issues.apache.org/jira/browse/FLINK-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15521110#comment-15521110
]
ASF GitHub Bot commented on FLINK-4552:
---------------------------------------
GitHub user aljoscha opened a pull request:
https://github.com/apache/flink/pull/2547
[FLINK-4552] Refactor WindowOperator/Trigger Tests
Before `WindowOperatorTest` was more like an integration test. We would
throw elements at `WindowOperator` and observe whether we got the correct
output.
The new `WindowOperatorTest` verifies the implicit contract between the
windowing components. I also added explicit tests for `WindowAssigners` and
`Triggers`. For triggers I added a new `TriggerTestHarness`. Also, I modified
`HeapKeyedStateBackend` to allow querying how many entries there are for a
given namespace, this allows testing whether trigger correctly clean up their
state. I also added the new interfaces `TimerService` and
`InternalTimerService` that should be used for all stuff concerning time and
timers. For now, these are only used in the tests but they should be used in
more components.
R: @StefanRRichter and @kl0u for review.
P.S. : I wanted to get this in before we get in the work on
triggers/trigger DSL to ensure that we don't break things and to modularize the
tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aljoscha/flink window-test-refactor
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2547.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2547
----
commit 90f6785d1038ebef8cd92965cd29a2d1da6e0370
Author: Aljoscha Krettek <[email protected]>
Date: 2016-09-05T10:01:11Z
[FLINK-4552] Refactor WindowOperator/Trigger Tests
commit 140d85ffff3364f98e70539861a1c1bb51f39a1b
Author: Aljoscha Krettek <[email protected]>
Date: 2016-09-24T13:41:10Z
Add WindowAssignerTests
commit 56f33789e22f0bdc056be34e92c523d7965bbad4
Author: Aljoscha Krettek <[email protected]>
Date: 2016-09-25T16:39:47Z
Add TriggerTests/TimerService
----
> Refactor WindowOperator/Trigger Tests
> -------------------------------------
>
> Key: FLINK-4552
> URL: https://issues.apache.org/jira/browse/FLINK-4552
> Project: Flink
> Issue Type: Improvement
> Components: Windowing Operators
> Reporter: Aljoscha Krettek
> Assignee: Aljoscha Krettek
>
> Right now, tests for {{WindowOperator}}, {{WindowAssigner}}, {{Trigger}} and
> {{WindowFunction}} are all conflated in {{WindowOperatorTest}}. All of these
> test that a certain combination of a {{Trigger}}, {{WindowAssigner}} and
> {{WindowFunction}} produce the expected output.
> We should modularize these tests and spread them out across multiple files,
> possibly one per trigger, for the triggers. Also, we should extend/change the
> tests in some key ways:
> - {{WindowOperatorTest}} test should just verify that the interaction
> between {{WindowOperator}} and the various other parts works as expected,
> that the correct methods on {{Trigger}} and {{WindowFunction}} are called at
> the expected time and that snapshotting, timers, cleanup etc. work correctly.
> These tests should also verify that the different state types and
> {{WindowFunctions}} work correctly.
> - {{Trigger}} tests should present elements to triggers and verify that they
> fire at the correct times. The actual output of the {{WindowFunction}} is not
> important for these tests. We should also test that triggers correctly clean
> up state and timers.
> - {{WindowAssigner}} tests should test each window assigner and also verify
> that, for example, the offset parameter of time-based windows works correctly.
> There is already {{WindowingTestHarness}} but it is not used by tests, I
> think we can expand on that and provide more thorough test coverage while
> also making the tests more maintainable ({{WindowOperatorTest.java}} is
> nearing 3000 lines of code).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)