You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2020/08/11 14:33:03 UTC

[activemq-artemis] branch master updated: NO-JIRA: fix RandomUtilDistributionTest assertion and improve failure message

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 131b8b2  NO-JIRA: fix RandomUtilDistributionTest assertion and improve failure message
     new d07c623  This closes #3235
131b8b2 is described below

commit 131b8b22ecc52cd68ba362d10f57506711bad1cb
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Wed Aug 5 17:37:22 2020 +0100

    NO-JIRA: fix RandomUtilDistributionTest assertion and improve failure message
---
 .../artemis/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 1786a36..3cd9cc9 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 {