[ 
https://issues.apache.org/jira/browse/BEAM-12931?focusedWorklogId=679415&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-679415
 ]

ASF GitHub Bot logged work on BEAM-12931:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Nov/21 01:15
            Start Date: 10/Nov/21 01:15
    Worklog Time Spent: 10m 
      Work Description: laraschmidt commented on a change in pull request 
#15540:
URL: https://github.com/apache/beam/pull/15540#discussion_r746171750



##########
File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ParDoTest.java
##########
@@ -1791,6 +1791,119 @@ public void finishBundle(FinishBundleContext c) {
   /** Tests to validate output timestamps. */
   @RunWith(JUnit4.class)
   public static class TimestampTests extends SharedTestBase implements 
Serializable {
+    /**
+     * A {@link DoFn} that outputs elements with timestamp equal to the input 
timestamp minus the
+     * input element.
+     */
+    private static class SkewingDoFn extends DoFn<Duration, String> {
+      private final Duration allowedSkew;
+      static final String CORRECT_ELEMENT = "element";
+
+      private SkewingDoFn(Duration allowedSkew) {
+        this.allowedSkew = allowedSkew;
+      }
+
+      @ProcessElement
+      public void processElement(ProcessContext context) {
+        Instant outputTimestamp = context.timestamp().minus(context.element());
+        try {
+          context.outputWithTimestamp(CORRECT_ELEMENT, outputTimestamp);
+        } catch (IllegalArgumentException e) {
+          // Errors differ between runners but at least check that the output 
timestamp is printed.

Review comment:
       Yeah though I still feel a bit odd checking specific error messages in 
multiple runners. I updated it to check the relevant pieces but not the 
specific wording.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 679415)
    Time Spent: 5h 50m  (was: 5h 40m)

> Timer.setOutputTimestamp doesn't take into account for 
> DoFn#getAllowedTimestampSkew()
> -------------------------------------------------------------------------------------
>
>                 Key: BEAM-12931
>                 URL: https://issues.apache.org/jira/browse/BEAM-12931
>             Project: Beam
>          Issue Type: Bug
>          Components: beam-model
>            Reporter: Lara Schmidt
>            Assignee: Lara Schmidt
>            Priority: P2
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> A DoFn may emit elements with a timestamp up to 
> DoFn#getAllowedTimestampSkew() before the current element's timestamp. 
> However getAllowedTimestampSkew is not properly accounted for in looking at 
> the output timestamp of a timer.
> Context: 
> [https://lists.apache.org/thread.html/r7554658114ddde86c5d82e1c39fe7e1ef587fe926b8e406d1130d501%40%3Cdev.beam.apache.org%3E]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to