From ded16f8f182c6527df1ea15830d65815227aed25 Mon Sep 17 00:00:00 2001 From: Steve Rowe Date: Wed, 8 Jun 2016 14:39:01 -0400 Subject: [PATCH] SOLR-9107: When creating a randomized SSL test config, 100% effective odds of using SSL and/or client auth should never be trumped by chance. --- .../src/java/org/apache/solr/util/RandomizeSSL.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java b/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java index e7336d8335d..2450dadc2df 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java +++ b/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java @@ -105,9 +105,9 @@ public @interface RandomizeSSL { // even if we know SSL is disabled, always consume the same amount of randomness // that way all other test behavior should be consistent even if a user adds/removes @SuppressSSL - final boolean useSSL = TestUtil.nextInt(LuceneTestCase.random(), 0, 1000) < + final boolean useSSL = TestUtil.nextInt(LuceneTestCase.random(), 0, 999) < (int)(1000 * getEffectiveOdds(ssl, LuceneTestCase.TEST_NIGHTLY, LuceneTestCase.RANDOM_MULTIPLIER)); - final boolean useClientAuth = TestUtil.nextInt(LuceneTestCase.random(), 0, 1000) < + final boolean useClientAuth = TestUtil.nextInt(LuceneTestCase.random(), 0, 999) < (int)(1000 * getEffectiveOdds(clientAuth, LuceneTestCase.TEST_NIGHTLY, LuceneTestCase.RANDOM_MULTIPLIER)); return new SSLTestConfig(useSSL, useClientAuth);