Repository: groovy Updated Branches: refs/heads/master 636cd1c47 -> 7cda9e415
Refine ConcurrentLinkedHashMapTest to ensure the order of map entries Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/7cda9e41 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7cda9e41 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7cda9e41 Branch: refs/heads/master Commit: 7cda9e4159b5018bd99cb4e0199bda751e8f5d8f Parents: 636cd1c Author: sunlan <[email protected]> Authored: Tue Jan 9 07:49:59 2018 +0800 Committer: sunlan <[email protected]> Committed: Tue Jan 9 07:49:59 2018 +0800 ---------------------------------------------------------------------- .../ConcurrentLinkedHashMapTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/7cda9e41/src/test/java/org/apache/groovy/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/groovy/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java b/src/test/java/org/apache/groovy/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java index 8659a33..6af32bd 100644 --- a/src/test/java/org/apache/groovy/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java +++ b/src/test/java/org/apache/groovy/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java @@ -64,7 +64,15 @@ public class ConcurrentLinkedHashMapTest { countDownLatch.await(); if (num != 0 && num != 1 && num != 2) { - Thread.sleep(500); + Thread.sleep(100); + } + + if (num == 1) { + Thread.sleep(30); + } + + if (num == 2) { + Thread.sleep(60); } m.computeIfAbsent(num % 3, k -> num);
