You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/04/19 23:38:00 UTC

[jira] [Work logged] (BEAM-7122) Accumulating triggers seem not to work on DirectRunner

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

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

                Author: ASF GitHub Bot
            Created on: 19/Apr/19 23:37
            Start Date: 19/Apr/19 23:37
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on issue #8364: [BEAM-7122] Adding an accumulating trigger test
URL: https://github.com/apache/beam/pull/8364#issuecomment-485038402
 
 
   r: @aaltay 
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

            Worklog Id:     (was: 230322)
            Time Spent: 10m
    Remaining Estimate: 0h

> Accumulating triggers seem not to work on DirectRunner
> ------------------------------------------------------
>
>                 Key: BEAM-7122
>                 URL: https://issues.apache.org/jira/browse/BEAM-7122
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Pablo Estrada
>            Assignee: Pablo Estrada
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Running this in DirectRunner.
> Test case:
> {code}
>   def test_multiple_accumulating_firings(self):
>     # PCollection will contain elements from 1 to 10.
>     elements = [i for i in range(1, 11)]
>     ts = TestStream().advance_watermark_to(0)
>     for i in elements:
>       ts.add_elements([str(i)])
>       if i % 5 == 0:
>         ts.advance_watermark_to(i)
>         ts.advance_processing_time(5)
>     with TestPipeline() as p:
>       _ = (p
>            | ts
>            | beam.WindowInto(
>                FixedWindows(10),
>                accumulation_mode=trigger.AccumulationMode.ACCUMULATING,
>                trigger=AfterWatermark(
>                    early=AfterAll(
>                        AfterCount(1), AfterProcessingTime(5))
>                ))
>            | beam.ParDo(self.record_dofn()))
>     # The trigger should fire twice. Once after 5 seconds, and once after 10.
>     # The firings should accumulate the output.
>     first_firing = [str(i) for i in elements if i <= 5]
>     second_firing = [str(i) for i in elements]
>     # Assert that we have two firings.
>     self.assertEqual(2, len(TriggerPipelineTest.all_firings))
>     self.assertListEqual(first_firing + second_firing,
>                          TriggerPipelineTest.all_records)
> {code}
> Failure:
> {code:java}
> ======================================================================
> FAIL: test_multiple_accumulating_firings (apache_beam.transforms.trigger_test.TriggerPipelineTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "apache_beam/transforms/trigger_test.py", line 488, in test_multiple_accumulating_firings
>     TriggerPipelineTest.all_records)
> AssertionError: Lists differ: ['1', '2', '3', '4', '5', '1',... != ['1', '2', '3', '4', '5', '6',...
> First differing element 5:
> '1'
> '6'
> First list contains 5 additional elements.
> First extra element 10:
> '6'
> - ['1', '2', '3', '4', '5', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
> ?                           -------------------------
> + ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)