solr
solr copied to clipboard
SOLR-18026 Fix failing test TestSolrCLIRunExample on java25
Spent 1/2 hour with Claude on this, and it all makes sense.
Root Cause
The SOLR-15442 commit (which synchronized port and host variable naming) made an incomplete update:
- What changed in SOLR-15442:
- Renamed jetty.port → solr.port.listen
- Renamed host → solr.host.advertise
- Updated solr.xml to use ${solr.host.advertise:} instead of ${host:}
- The bug:
- TestSolrCLIRunExample.java was updated to use solr.port.listen ✅
- But it still used the deprecated
hostproperty instead ofsolr.host.advertise❌ - TestHarness.java also still used the old
hostproperty ❌
- Why it failed:
- The test sets System.setProperty("host", "localhost") after EnvUtils initialization
- The deprecated property mapping only runs during static initialization
- So
solr.host.advertiseremained unset - Solr nodes couldn't register properly in ZooKeeper
- Result: "No live SolrServers available to handle this request"
Files Fixed
- TestSolrCLIRunExample.java (lines 127, 215, and JavaDoc):
- Changed System.setProperty("host", "localhost")
- To System.setProperty("solr.host.advertise", "localhost")
- TestHarness.java (line 191):
- Changed System.getProperty("host")
- To System.getProperty("solr.host.advertise")
https://issues.apache.org/jira/browse/SOLR-18026
Other tests could also be at risk if they MODIFY the deprecated variant, and it is read by Solr with the new name.
The unrelated precommit failure is due to a commit on SOLR-17928 yesterday, I left a note there...