Skip to content

Commit 0311cd2

Browse files
author
Mathieu Chartier
committed
Increase ThreadTest tolerance
Aims to fix flaky test. Decreased minimum from 90% to 80%. Increased maximum from 110% to 120%. Increased maximum waitMillis from 10ms to 30ms. Bug: 18788389 Change-Id: I92477225492712448b0a78354730a037e2dda1a1
1 parent 3a1658c commit 0311cd2

File tree

1 file changed

+3
-3
lines changed
  • harmony-tests/src/test/java/org/apache/harmony/tests/org/apache/harmony/kernel/dalvik

1 file changed

+3
-3
lines changed

harmony-tests/src/test/java/org/apache/harmony/tests/org/apache/harmony/kernel/dalvik/ThreadsTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ public void assertDurationIsInRange(long expectedMillis) {
234234
* Allow a bit more slop for the maximum on "expected
235235
* instantaneous" results.
236236
*/
237-
long minimum = (long) ((double) expectedMillis * 0.90);
237+
long minimum = (long) ((double) expectedMillis * 0.80);
238238
long maximum =
239-
Math.max((long) ((double) expectedMillis * 1.10), 10);
240-
long waitMillis = Math.max(expectedMillis * 10, 10);
239+
Math.max((long) ((double) expectedMillis * 1.20), 10);
240+
long waitMillis = Math.max(expectedMillis * 10, 30);
241241
long duration = getDurationMillis(waitMillis);
242242

243243
if (duration < minimum) {

0 commit comments

Comments
 (0)