Skip to content

Commit

Permalink
SOLR-16975: Use default solrXml if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
janhoy committed Sep 13, 2023
1 parent 7c3e295 commit 85b59fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ public MiniSolrCloudCluster(
.withUrl(zkServer.getZkHost())
.withTimeout(AbstractZkTestCase.TIMEOUT, TimeUnit.MILLISECONDS)
.build()) {
zkClient.makePath("/solr", false, true);
if (!zkClient.exists("/solr/clusterprops.json", true)) {
if (!zkClient.exists("/solr", true)) {
zkClient.makePath("/solr", false, true);
if (jettyConfig.sslConfig != null && jettyConfig.sslConfig.isSSLMode()) {
zkClient.makePath(
"/solr" + ZkStateReader.CLUSTER_PROPS,
Expand Down Expand Up @@ -502,9 +502,10 @@ public JettySolrRunner startJettySolrRunner(String name, JettyConfig config, Str
nodeProps.setProperty("zkHost", zkServer.getZkAddress());

Path runnerPath = createInstancePath(name);
if (solrXml != null) {
Files.write(runnerPath.resolve("solr.xml"), solrXml.getBytes(StandardCharsets.UTF_8));
if (solrXml == null) {
solrXml = DEFAULT_CLOUD_SOLR_XML;
}
Files.write(runnerPath.resolve("solr.xml"), solrXml.getBytes(StandardCharsets.UTF_8));
JettyConfig newConfig = JettyConfig.builder(config).build();
JettySolrRunner jetty =
!trackJettyMetrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ public JettySolrRunner startJettySolrRunner(
nodeProps.setProperty("test-from-sysprop", "yup");

Path runnerPath = createTempDir(name);
if (solrXml != null) {
Files.write(
runnerPath.resolve("solr.xml"), solrXml.getBytes(StandardCharsets.UTF_8));
if (solrXml == null) {
solrXml = DEFAULT_CLOUD_SOLR_XML;
}
Files.write(
runnerPath.resolve("solr.xml"), solrXml.getBytes(StandardCharsets.UTF_8));
JettyConfig newConfig = JettyConfig.builder(config).build();
JettySolrRunner jetty =
new JettySolrRunner(runnerPath.toString(), nodeProps, newConfig);
Expand Down

0 comments on commit 85b59fa

Please sign in to comment.