File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
core/src/test/org/apache/solr/cloud
test-framework/src/java/org/apache/solr Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 3737import org .apache .solr .embedded .JettyConfig ;
3838import org .apache .solr .embedded .JettySolrRunner ;
3939import org .apache .solr .util .SSLTestConfig ;
40+ import org .junit .After ;
4041import org .junit .Test ;
4142
4243/**
4748@ AwaitsFix (bugUrl = "https://issues.apache.org/jira/browse/SOLR-12028" ) // 17-Mar-2018
4849public class SSLMigrationTest extends AbstractFullDistribZkTestBase {
4950
51+ @ After
52+ public void afterTest () {
53+ HttpClientUtil .resetHttpClientBuilder (); // also resets SocketFactoryRegistryProvider
54+ }
55+
5056 @ Test
5157 public void test () throws Exception {
5258 // Migrate from HTTP -> HTTPS -> HTTP
@@ -64,7 +70,7 @@ public void testMigrateSSL(SSLTestConfig sslConfig) throws Exception {
6470 }
6571
6672 HttpClientUtil .setSocketFactoryRegistryProvider (
67- sslConfig .buildClientSocketFactoryRegistryProvider ());
73+ sslConfig .buildClientSocketFactoryRegistryProvider ()); // we reset in After
6874 for (int i = 0 ; i < this .jettys .size (); i ++) {
6975 JettySolrRunner runner = jettys .get (i );
7076 JettyConfig config =
Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ public void after() {
104104 public void testNoSsl () throws Exception {
105105 final SSLTestConfig sslConfig = new SSLTestConfig (false , false );
106106 HttpClientUtil .setSocketFactoryRegistryProvider (
107- sslConfig .buildClientSocketFactoryRegistryProvider ());
108- Http2SolrClient .setDefaultSSLConfig (sslConfig .buildClientSSLConfig ());
107+ sslConfig .buildClientSocketFactoryRegistryProvider ()); // must be reset
108+ Http2SolrClient .setDefaultSSLConfig (sslConfig .buildClientSSLConfig ()); // must be reset
109109 System .setProperty (ZkStateReader .URL_SCHEME , "http" );
110110 checkClusterWithNodeReplacement (sslConfig );
111111 }
Original file line number Diff line number Diff line change @@ -327,8 +327,6 @@ public static void teardownTestCases() throws Exception {
327327 System .clearProperty (URL_SCHEME );
328328 System .clearProperty ("solr.cloud.wait-for-updates-with-stale-state-pause" );
329329 System .clearProperty ("solr.zkclienttmeout" );
330- HttpClientUtil .resetHttpClientBuilder ();
331- Http2SolrClient .resetSslContextFactory ();
332330
333331 clearNumericTypesProperties ();
334332
You can’t perform that action at this time.
0 commit comments