Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/testing/randomization.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ configure(allprojects.findAll {project -> project.path.startsWith(":solr")}) {
testOptions += [
[propName: 'tests.src.home', value: null, description: "See SOLR-14023."],
[propName: 'solr.tests.use.numeric.points', value: null, description: "Point implementation to use (true=numerics, false=trie)."],
[propName: 'tests.ssl', value: false, description: "Force SSL on for all tests that support it (respects @SuppressSSL)."],
[propName: 'tests.ssl', value: null, description: "Control SSL: true=force on, false=force off, unset=randomize (all respect @SuppressSSL)."],
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ public static void beforeClass() throws Exception {

@AfterClass
public static void afterClass() throws Exception {
jettyHttpClient.destroy();
cluster.shutdown();
if (jettyHttpClient != null) {
jettyHttpClient.destroy();
jettyHttpClient = null;
}
if (cluster != null) {
cluster.shutdown();
cluster = null;
}
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.solr.util;

import static org.junit.Assume.assumeFalse;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
Expand Down Expand Up @@ -126,8 +128,14 @@ public SSLTestConfig createSSLTestConfig() {
LuceneTestCase.TEST_NIGHTLY,
LuceneTestCase.RANDOM_MULTIPLIER));

if (Boolean.getBoolean("tests.ssl") && ssl > 0.0D) {
// a test can configure @RandomizeSSL(0.0) or with 1.0, and we must honor that.
final String sslProp = System.getProperty("tests.ssl");
if ("true".equals(sslProp)) {
assumeFalse("tests.ssl=true but test does not support SSL", ssl == 0.0);
return new SSLTestConfig(true, useClientAuth);
} else if ("false".equals(sslProp)) {
assumeFalse("tests.ssl=false but test requires SSL", ssl == 1.0);
return new SSLTestConfig(false, false);
}

return new SSLTestConfig(useSSL, useClientAuth);
Expand Down
Loading