JayajP commented on code in PR #29808:
URL: https://github.com/apache/beam/pull/29808#discussion_r1437852114


##########
sdks/java/core/src/test/java/org/apache/beam/sdk/util/HistogramDataTest.java:
##########
@@ -357,27 +357,74 @@ public void testStatistics_sumOfSquaredDeviations() {
 
   @Test
   public void testGetAndReset_resetSucceeds() {
-    HistogramData originalHistogram = HistogramData.linear(0, 10, 10);
+    // Records values from [20, 50) in three buckets that have width 10.
+    HistogramData originalHistogram = HistogramData.linear(20, 10, 3);
     originalHistogram.record(15.0, 25.0, 35.0, 45.0);
     originalHistogram.getAndReset();
 
-    HistogramData emptyHistogramData = HistogramData.linear(0, 10, 10);
+    HistogramData emptyHistogramData = HistogramData.linear(20, 10, 3);

Review Comment:
   The spacing for `originalHistogram` and `emptyHistogramData` need to be 
equal. If I used the original spacing for both histograms then it would still 
pass the test; however, I wanted to ensure these tests were incrementing the 
underflow/overflow buckets. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to