CURATOR-254 - Modified the test assertions so that they ensure that the theoretical maximum queue size is not exceeded. The previous limit was exceedable depending on how quick consumers were pulling data off the queue.
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/970bd396 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/970bd396 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/970bd396 Branch: refs/heads/CURATOR-3.0 Commit: 970bd3963cdca545580460e34ccaead8e9c212f7 Parents: 9d2d685 Author: Cam McKenzie <cammcken...@apache.org> Authored: Tue Sep 1 09:13:06 2015 +1000 Committer: Cam McKenzie <cammcken...@apache.org> Committed: Tue Sep 1 09:13:06 2015 +1000 ---------------------------------------------------------------------- .../framework/recipes/queue/TestBoundedDistributedQueue.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/970bd396/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java index 973ef51..80b4861 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java @@ -67,7 +67,6 @@ public class TestBoundedDistributedQueue extends BaseClassForTests final int CLIENT_QTY = 4; final int MAX_ITEMS = 10; final int ADD_ITEMS = MAX_ITEMS * 100; - final int SLOP_FACTOR = 2; final QueueConsumer<String> consumer = new QueueConsumer<String>() { @@ -181,7 +180,7 @@ public class TestBoundedDistributedQueue extends BaseClassForTests for ( int count : counts ) { - Assert.assertTrue(count <= (MAX_ITEMS * SLOP_FACTOR), counts.toString()); + Assert.assertTrue(count <= (MAX_ITEMS * CLIENT_QTY), counts.toString()); } } finally