Skip to content

Apache Lucene open-source search software

SOLR-10024: If you use ExternalPaths#determineSourceHome with a custom tests.workDir, tests may not find the path.

markrmiller98a5a8137826
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 44d7353815a..c1713865a30 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -1060,6 +1060,8 @@
<!-- turn jenkins blood red for hashmap bugs, even on jdk7 -->
<sysproperty key="jdk.map.althashing.threshold" value="0"/>
+ <sysproperty key="tests.src.home" value="${user.dir}" />
+
<!-- Only pass these to the test JVMs if defined in ANT. -->
<syspropertyset>
<propertyref prefix="tests.maxfailures" />
diff --git a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
index 3e91d8122a0..e5a83efc4aa 100644
--- a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
+++ b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
@@ -63,7 +63,7 @@ public class ExternalPaths {
}
} catch (Exception e) {
// If there is no "solr/conf" in the classpath, fall back to searching from the current directory.
- file = new File(".");
+ file = new File(System.getProperty("tests.src.home", "."));
}
File base = file.getAbsoluteFile();
while (!(new File(base, "solr/CHANGES.txt").exists()) && null != base) {