[
https://issues.apache.org/jira/browse/BEAM-3755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17131735#comment-17131735
]
Beam JIRA Bot commented on BEAM-3755:
-------------------------------------
This issue is P2 but has been unassigned without any comment for 60 days so it
has been labeled "stale-P2". If this issue is still affecting you, we care!
Please comment and remove the label. Otherwise, in 14 days the issue will be
moved to P3.
Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed
explanation of what these priorities mean.
> Unable to Test Session "with gap duration" Windowing
> ----------------------------------------------------
>
> Key: BEAM-3755
> URL: https://issues.apache.org/jira/browse/BEAM-3755
> Project: Beam
> Issue Type: Bug
> Components: testing
> Affects Versions: 2.2.0
> Environment: Java
> Reporter: Joe
> Priority: P2
> Labels: stale-P2
>
> Trying to write a unit test to verify the windowing behavior for session with
> gap duration, but my assumption is that there is a merging of IntervalWindows
> that normally happens that is not happening for my test pipeline, because my
> actual pipeline seems to work as expected, but my test fails.
> I have been using these resources:
> [http://www.waitingforcode.com/apache-beam/windows-apache-beam/read]
> [https://beam.apache.org/blog/2016/10/20/test-stream.html]
>
> Here is an example of the issue:
> {code:java}
> String guid = "user1";
> UniqueUserKey uniqueUser = makeUniqueUserKey(guid);
> // the first value to makePageView results in the timestamp: new
> Instant(value)
> TimestampedValue<KV<UniqueUserKey, PageLoadEvent>> homepage = makePageView(1,
> "HomePage", "homepage", guid, uniqueUser);
> TimestampedValue<KV<UniqueUserKey, PageLoadEvent>> productDetails1 =
> makePageView(2, "Product Details", "product_details", guid, uniqueUser);
> TestStream<KV<UniqueUserKey, PageLoadEvent>> testStream =
> TestStream.create(KvCoder.of(ProtoCoder.of(UniqueUserKey.class),
> ProtoCoder.of(PageLoadEvent.class)))
> .addElements(homepage)
> .addElements(productDetails1)
> .advanceWatermarkTo(new Instant(8))
> .advanceWatermarkToInfinity();
> IntervalWindow window1 = new IntervalWindow(new Instant(1), new Instant(3));
> // This fails because productDetails1 is not in the window
> PAssert.that(firstTransform).inFinalPane(window1).containsInAnyOrder(
> homepage.getValue(),
> productDetails1.getValue());
> pipeline.run().waitUntilFinish();{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)