You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by am...@apache.org on 2019/11/14 22:37:28 UTC

[beam] branch master updated: [BEAM-8575] Fix window assignment idempotency tests non-deterministic elements order

This is an automated email from the ASF dual-hosted git repository.

amyrvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 312535e  [BEAM-8575] Fix window assignment idempotency tests non-deterministic elements order
     new 9009dd1  Merge pull request #10111 from liumomo315/fix_window_idempotency
312535e is described below

commit 312535e4545e5bbffc76032b7f2cd3da6d287559
Author: Wenjia Liu <we...@google.com>
AuthorDate: Thu Nov 14 11:49:20 2019 -0800

    [BEAM-8575] Fix window assignment idempotency tests non-deterministic elements order
---
 sdks/python/apache_beam/transforms/window_test.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sdks/python/apache_beam/transforms/window_test.py b/sdks/python/apache_beam/transforms/window_test.py
index 0d5e14f..3c45d83 100644
--- a/sdks/python/apache_beam/transforms/window_test.py
+++ b/sdks/python/apache_beam/transforms/window_test.py
@@ -286,21 +286,21 @@ class WindowTest(unittest.TestCase):
   @attr('ValidatesRunner')
   def test_window_assignment_idempotency(self):
     with TestPipeline() as p:
-      pcoll = self.timestamped_key_values(p, 'key', 0, 1, 2, 3, 4)
+      pcoll = self.timestamped_key_values(p, 'key', 0, 2, 4)
       result = (pcoll
                 | 'window' >> WindowInto(FixedWindows(2))
                 | 'same window' >> WindowInto(FixedWindows(2))
                 | 'same window again' >> WindowInto(FixedWindows(2))
                 | GroupByKey())
 
-      assert_that(result, equal_to([('key', [0, 1]),
-                                    ('key', [2, 3]),
+      assert_that(result, equal_to([('key', [0]),
+                                    ('key', [2]),
                                     ('key', [4])]))
 
   @attr('ValidatesRunner')
   def test_window_assignment_through_multiple_gbk_idempotency(self):
     with TestPipeline() as p:
-      pcoll = self.timestamped_key_values(p, 'key', 0, 1, 2, 3, 4)
+      pcoll = self.timestamped_key_values(p, 'key', 0, 2, 4)
       result = (pcoll
                 | 'window' >> WindowInto(FixedWindows(2))
                 | 'gbk' >> GroupByKey()
@@ -309,8 +309,8 @@ class WindowTest(unittest.TestCase):
                 | 'same window again' >> WindowInto(FixedWindows(2))
                 | 'gbk again' >> GroupByKey())
 
-      assert_that(result, equal_to([('key', [[[0, 1]]]),
-                                    ('key', [[[2, 3]]]),
+      assert_that(result, equal_to([('key', [[[0]]]),
+                                    ('key', [[[2]]]),
                                     ('key', [[[4]]])]))
 
 class RunnerApiTest(unittest.TestCase):