beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pabl...@apache.org
Subject [beam] branch master updated: [BEAM-4426]: Addressed DataflowDistributionAccumulatorTest failure on Windows
Date Tue, 29 May 2018 23:39:28 GMT
This is an automated email from the ASF dual-hosted git repository.

pabloem 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 7b25821  [BEAM-4426]: Addressed DataflowDistributionAccumulatorTest failure on Windows
7b25821 is described below

commit 7b25821b0b473e075b4e410177daebfb381d4598
Author: Boyuan Zhang <boyuanz@google.com>
AuthorDate: Tue May 29 13:50:48 2018 -0700

    [BEAM-4426]: Addressed DataflowDistributionAccumulatorTest failure on Windows
---
 .../apache_beam/transforms/dataflow_distribution_counter_test.py   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sdks/python/apache_beam/transforms/dataflow_distribution_counter_test.py b/sdks/python/apache_beam/transforms/dataflow_distribution_counter_test.py
index e19eee6..e3d3c6e 100644
--- a/sdks/python/apache_beam/transforms/dataflow_distribution_counter_test.py
+++ b/sdks/python/apache_beam/transforms/dataflow_distribution_counter_test.py
@@ -14,14 +14,14 @@ When Cython is available, unit tests will test on cythonized module,
 otherwise, test on pure python module
 """
 
-import math
-import sys
 import unittest
 
 from mock import Mock
 
 from apache_beam.transforms import DataflowDistributionCounter
 
+INT64_MAX = 2**63 - 1
+
 
 class DataflowDistributionAccumulatorTest(unittest.TestCase):
   def test_calculate_bucket_index_with_input_0(self):
@@ -33,7 +33,6 @@ class DataflowDistributionAccumulatorTest(unittest.TestCase):
     counter = DataflowDistributionCounter()
     bucket = 1
     power_of_ten = 1
-    INT64_MAX = math.pow(2, 63) - 1
     while power_of_ten <= INT64_MAX:
       for multiplier in [1, 2, 5]:
         value = multiplier * power_of_ten
@@ -71,7 +70,7 @@ class DataflowDistributionAccumulatorTest(unittest.TestCase):
 
   def test_translate_to_histogram_with_max_input(self):
     counter = DataflowDistributionCounter()
-    counter.add_input(sys.maxint)
+    counter.add_input(INT64_MAX)
     histogram = Mock(firstBucketOffset=None, bucketCounts=None)
     counter.translate_to_histogram(histogram)
     self.assertEquals(histogram.firstBucketOffset, 57)

-- 
To stop receiving notification emails like this one, please contact
pabloem@apache.org.

Mime
View raw message