Refine `MemoizeAtMostTest` (cherry picked from commit dcbe543)
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d9205b76 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d9205b76 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d9205b76 Branch: refs/heads/master Commit: d9205b76a2606aee761bb34dce1bdb1effa01d50 Parents: d6cf690 Author: danielsun1106 <[email protected]> Authored: Sat Mar 3 20:25:14 2018 +0800 Committer: danielsun1106 <[email protected]> Committed: Sat Mar 3 20:33:27 2018 +0800 ---------------------------------------------------------------------- .../org/codehaus/groovy/runtime/memoize/MemoizeAtMostTest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/d9205b76/src/test/org/codehaus/groovy/runtime/memoize/MemoizeAtMostTest.groovy ---------------------------------------------------------------------- diff --git a/src/test/org/codehaus/groovy/runtime/memoize/MemoizeAtMostTest.groovy b/src/test/org/codehaus/groovy/runtime/memoize/MemoizeAtMostTest.groovy index 6d727ae..44590e5 100644 --- a/src/test/org/codehaus/groovy/runtime/memoize/MemoizeAtMostTest.groovy +++ b/src/test/org/codehaus/groovy/runtime/memoize/MemoizeAtMostTest.groovy @@ -82,6 +82,6 @@ public class MemoizeAtMostTest extends AbstractMemoizeTestCase { [4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6].collect { num -> Thread.start { mem(num) } }*.join() int c = cnt.get() - assert 3 <= c && c <= 6 // cached result may be GCed due to SoftReference, so `c` may be greater than 3(in most cases, its value is 3) + assert 3 <= c && c <= 12 // cached result may be GCed due to SoftReference, so `c` may be greater than 3(in most cases, its value is 3) } }
