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

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

                Author: ASF GitHub Bot
            Created on: 03/Mar/20 18:28
            Start Date: 03/Mar/20 18:28
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on pull request #10951: [BEAM-8575] 
Modified the test to work for different runners.
URL: https://github.com/apache/beam/pull/10951#discussion_r387210573
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/combiners_test.py
 ##########
 @@ -482,9 +492,20 @@ def 
test_combining_with_accumulation_mode_and_fanout(self):
               trigger=AfterWatermark(early=AfterAll(AfterCount(1))))
           | beam.CombineGlobally(sum).without_defaults().with_fanout(2))
 
-      # The frings for DISCARDING mode is [1, 2, 3, 4, 5, 0, 0].
-      firings = [1, 3, 6, 10, 15, 15, 15]
-      assert_that(result, equal_to(firings))
+      # Partition the result into early_firings and _.
+      # In ACCUMULATING mode, the early_frings is [1, 3, 6, 10],
+      # other_firings is [15, 15, ...]. Different runners have different
+      # number of 15s, but there should be at least one 15.
+      smaller_than_fifteen, fifteen, greater_than_fifteen = (
 
 Review comment:
   Rather than do a partition, I would write something like
   
   ```
   def has_expected_values(actual):
     ordered = sorted(actual)
     # Early firings.
     hamcrest.assert_that(ordered[:4], hamcrest.contains(1, 3, 6, 10))
     # Different runners have different number of 15s, but there should be at 
least one 15.
     hamcrest.assert_that(set(ordered[4:]), hamcrest.contains(15))
   assert_that(result, has_expected_values)
   ```
 
----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 396916)
    Time Spent: 58h  (was: 57h 50m)

> Add more Python validates runner tests
> --------------------------------------
>
>                 Key: BEAM-8575
>                 URL: https://issues.apache.org/jira/browse/BEAM-8575
>             Project: Beam
>          Issue Type: Test
>          Components: sdk-py-core, testing
>            Reporter: wendy liu
>            Assignee: wendy liu
>            Priority: Major
>          Time Spent: 58h
>  Remaining Estimate: 0h
>
> This is the umbrella issue to track the work of adding more Python tests to 
> improve test coverage.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to