Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-13747: New TestSSLTestConfig.testFailIfUserRunsTestsWithJVMThatHasKnownSSLBugs() to give people running tests more visibility if/when they use a known-buggy JVM causing most SSL tests to silently SKIP

Chris Hostetterec9780c8aad7
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 34e172c53da..c0ecf81cd21 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -265,6 +265,9 @@ Other Changes
* SOLR-11492: Clean up /solr/cloud-dev scripts and provide a single well documented script (Gus Heck, Robert Bunch)
+* SOLR-13747: New TestSSLTestConfig.testFailIfUserRunsTestsWithJVMThatHasKnownSSLBugs() to give people running
+ tests more visibility if/when they use a known-buggy JVM causing most SSL tests to silently SKIP. (hossman)
+
================== 8.2.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/test-framework/src/test/org/apache/solr/util/TestSSLTestConfig.java b/solr/test-framework/src/test/org/apache/solr/util/TestSSLTestConfig.java
index 4e3995469c0..ed2345977c9 100644
--- a/solr/test-framework/src/test/org/apache/solr/util/TestSSLTestConfig.java
+++ b/solr/test-framework/src/test/org/apache/solr/util/TestSSLTestConfig.java
@@ -20,6 +20,8 @@ package org.apache.solr.util;
import java.util.Arrays;
import java.util.List;
+import org.apache.lucene.util.Constants;
+
import org.apache.solr.SolrTestCase;
public class TestSSLTestConfig extends SolrTestCase {
@@ -84,4 +86,19 @@ public class TestSSLTestConfig extends SolrTestCase {
}
+ public void testFailIfUserRunsTestsWithJVMThatHasKnownSSLBugs() {
+ // NOTE: If there is some future JVM version, where all available "ea" builds are known to be buggy,
+ // but we still want to be able to use for running tests (ie: via jenkins) to look for *other* bugs,
+ // then those -ea versions can be "white listed" here...
+
+ try {
+ SSLTestConfig.assumeSslIsSafeToTest();
+ } catch (org.junit.AssumptionViolatedException ave) {
+ fail("Current JVM (" + Constants.JVM_NAME + " / " + Constants.JVM_VERSION +
+ ") is known to have SSL Bugs. Other tests that (explicitly or via randomization) " +
+ " use SSL will be SKIPed");
+ }
+ }
+
+
}