desensitize WindowTest.timeBatchEnsureUnique
got a: Number of batches expected:<3> but was:<4>
diff --git a/api/window/src/test/java/org/apache/edgent/test/window/WindowTest.java b/api/window/src/test/java/org/apache/edgent/test/window/WindowTest.java
index e563d38..ca2863d 100644
--- a/api/window/src/test/java/org/apache/edgent/test/window/WindowTest.java
+++ b/api/window/src/test/java/org/apache/edgent/test/window/WindowTest.java
@@ -487,6 +487,8 @@
numTuples += batches.get(batches.size() -1).size();
assertEquals("Number of batch tuples", count.get(), numTuples);
assertEquals("Number of batches", MAX_TUP_CNT/100, batches.size());
+ assertTrue("Number of batches exp:"+MAX_TUP_CNT/100+" got:"+batches.size(),
+ withinToleranceAmt((double)MAX_TUP_CNT/100, (double)batches.size(), 1)); // +/- 1
}
private void assertOnTimeEvictions(List<Long> diffs) {
@@ -503,4 +505,10 @@
return (actual < highBound && actual > lowBound);
}
+ public static boolean withinToleranceAmt(double expected, Double actual, double toleranceAmt) {
+ double lowBound = expected - toleranceAmt;
+ double highBound = expected + toleranceAmt;
+ return (actual < highBound && actual > lowBound);
+ }
+
}