[
https://issues.apache.org/jira/browse/FLINK-4230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384274#comment-15384274
]
ASF GitHub Bot commented on FLINK-4230:
---------------------------------------
Github user aljoscha commented on the issue:
https://github.com/apache/flink/pull/2263
Oh, and I forgot: the checking for the correct number of elements can be
moved out of the window function and into the test itself, like this:
```
JobExecutionResult result = env.execute();
Assert.assertEquals(
(LATE_EVENTS_PER_SESSION + 1) * NUMBER_OF_SESSIONS *
EVENTS_PER_SESSION,
result.getAccumulatorResult(SESSION_COUNTER_ON_TIME_KEY));
Assert.assertEquals(
NUMBER_OF_SESSIONS * (LATE_EVENTS_PER_SESSION *
(LATE_EVENTS_PER_SESSION + 1) / 2),
result.getAccumulatorResult(SESSION_COUNTER_LATE_KEY));
```
Also, you can let the test class extend
`StreamingMultipleProgramsTestBase`. This will setup a testing cluster with
parallelism 4. You can then use this inside your test:
```
StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment()
```
If you make the source non-parallel the window operator will then run with
parallelism 4 and counting the number of elements after the job is done will
accumulate the counts from all parallel instances.
> Session Windowing IT Case
> -------------------------
>
> Key: FLINK-4230
> URL: https://issues.apache.org/jira/browse/FLINK-4230
> Project: Flink
> Issue Type: Test
> Components: DataStream API, Local Runtime
> Reporter: Stefan Richter
> Assignee: Stefan Richter
>
> An ITCase for Session Windows is missing that tests correct behavior under
> several parallel sessions, with timely events, late events within and after
> the lateness interval.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)