This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_10x by this push:
     new 1b89f0b3850 SOLR-18026 Fix failing test TestSolrCLIRunExample on 
java25 (#3944)
1b89f0b3850 is described below

commit 1b89f0b3850e9f17cb62f2a8b560eea7da092d73
Author: Jan Høydahl <[email protected]>
AuthorDate: Sun Dec 14 18:48:32 2025 +0100

    SOLR-18026 Fix failing test TestSolrCLIRunExample on java25 (#3944)
    
    (cherry picked from commit 31ac7ae3d63c3edf2f4a55f5131f2848a14c5f5e)
---
 .../test/org/apache/solr/cli/TestSolrCLIRunExample.java   | 15 +++++++++------
 .../src/java/org/apache/solr/util/TestHarness.java        |  2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java 
b/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java
index 55a70326e87..653adb6d74e 100644
--- a/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java
@@ -69,8 +69,11 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
   }
 
   @AfterClass
-  public static void cleanupDirectoryFactory() {
+  public static void cleanup() {
     System.clearProperty("solr.directoryFactory");
+    System.clearProperty("solr.host.advertise");
+    System.clearProperty("solr.port.listen");
+    System.clearProperty("solr.log.dir");
   }
 
   /**
@@ -124,7 +127,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
           if (solrCloudCluster == null) {
             Path logDir = createTempDir("solr_logs");
             System.setProperty("solr.log.dir", logDir.toString());
-            System.setProperty("host", "localhost");
+            System.setProperty("solr.host.advertise", "localhost");
             System.setProperty("solr.port.listen", String.valueOf(port));
             solrCloudCluster = new MiniSolrCloudCluster(1, createTempDir(), 
solrxml, jettyConfig);
           } else {
@@ -212,7 +215,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
 
       Path solrHomeDir = Path.of(getArg("--solr-home", args));
 
-      System.setProperty("host", "localhost");
+      System.setProperty("solr.host.advertise", "localhost");
       System.setProperty("solr.port.listen", String.valueOf(port));
       System.setProperty("solr.logs.dir", 
createTempDir("solr_logs").toString());
 
@@ -418,9 +421,9 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
 
   /**
    * Tests the interactive SolrCloud example; we cannot test the 
non-interactive because we need
-   * control over the port and can only test with one node since the test 
relies on setting the host
-   * and solr.port.listen system properties, i.e. there is no test coverage 
for the --no-prompt
-   * option.
+   * control over the port and can only test with one node since the test 
relies on setting the
+   * solr.host.advertise and solr.port.listen system properties, i.e. there is 
no test coverage for
+   * the --no-prompt option.
    */
   @Test
   public void testInteractiveSolrCloudExample() throws Exception {
diff --git a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java 
b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
index 300aa7c3185..de02f1b2ccf 100644
--- a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
+++ b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
@@ -188,7 +188,7 @@ public class TestHarness extends BaseTestHarness {
         (null == System.getProperty("zkHost"))
             ? null
             : new CloudConfig.CloudConfigBuilder(
-                    System.getProperty("host"), Integer.getInteger("hostPort", 
8983))
+                    System.getProperty("solr.host.advertise"), 
Integer.getInteger("hostPort", 8983))
                 
.setZkClientTimeout(SolrZkClientTimeout.DEFAULT_ZK_CLIENT_TIMEOUT)
                 .setZkHost(System.getProperty("zkHost"))
                 .build();

Reply via email to