Skip to content

Apache Lucene open-source search software

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.

Steve Rowe86c053dd1055
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);