From 131b8b22ecc52cd68ba362d10f57506711bad1cb Mon Sep 17 00:00:00 2001 From: Robbie Gemmell Date: Wed, 5 Aug 2020 17:37:22 +0100 Subject: [PATCH] NO-JIRA: fix RandomUtilDistributionTest assertion and improve failure message --- .../tests/unit/core/util/RandomUtilDistributionTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java index 1786a36113..3cd9cc9ae7 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java @@ -69,9 +69,8 @@ public class RandomUtilDistributionTest { // Be careful removing it (make sure you know what you're doing in case you do so) int minimumExpected = (int) ((iterations * numberOfStarts) * 0.80); - log.debug("value=" + value + ", minimum expected = " + minimumExpected); - Assert.assertTrue("The Random distribution is pretty bad. All tries have returned duplicated randoms. value=" + value + ", minimum expected = " + minimumExpected, value > minimumExpected); - + log.debug("values = " + value + ", minimum expected = " + minimumExpected); + Assert.assertTrue("The Random distribution is pretty bad. Many tries have returned duplicated randoms. Number of different values=" + value + ", minimum expected = " + minimumExpected, value >= minimumExpected); } private int internalDistributionTest(int numberOfTries) throws Exception {