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

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

                Author: ASF GitHub Bot
            Created on: 29/May/18 23:39
            Start Date: 29/May/18 23:39
    Worklog Time Spent: 10m 
      Work Description: pabloem closed pull request #5504: [BEAM-4426]: 
Addressed DataflowDistributionAccumulatorTest failure
URL: https://github.com/apache/beam/pull/5504
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 e19eee6de3e..e3d3c6e5a5a 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 @@
 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 @@ def test_calculate_bucket_index_within_max_long(self):
     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 @@ def test_translate_to_histogram_with_input_0(self):
 
   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)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 106948)
    Time Spent: 1h 20m  (was: 1h 10m)

> apache_beam.transforms.dataflow_distribution_counter_test failed on Windows
> ---------------------------------------------------------------------------
>
>                 Key: BEAM-4426
>                 URL: https://issues.apache.org/jira/browse/BEAM-4426
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-harness
>            Reporter: Boyuan Zhang
>            Assignee: Boyuan Zhang
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> apache_beam.transforms.dataflow_distributio
> n_counter_test:DataflowDistributionAccumulatorTest.test_translate_to_histogram_with_max_input
> test_translate_to_histogram_with_max_input 
> (apache_beam.transforms.dataflow_distribution_counter_test.DataflowDistributi
> onAccumulatorTest) ... FAIL
> ======================================================================
> FAIL: test_translate_to_histogram_with_max_input 
> (apache_beam.transforms.dataflow_distribution_counter_test.DataflowDist
> ributionAccumulatorTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File 
> "beam\sdks\python\apache_beam\transforms\dataflow_distribution_counter_test.py",
>  li
> ne 77, in test_translate_to_histogram_with_max_input
>     self.assertEquals(histogram.firstBucketOffset, 57)
> AssertionError: 29 != 57



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

Reply via email to