You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ge...@apache.org on 2026/01/22 14:21:55 UTC
(solr) branch main updated: Fix TestReplicationHandler.testUrlAllowListFailure
This is an automated email from the ASF dual-hosted git repository.
gerlowskija pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new ffe9f2c4d6a Fix TestReplicationHandler.testUrlAllowListFailure
ffe9f2c4d6a is described below
commit ffe9f2c4d6acbbb0855a974b3073a4fab78a2030
Author: Jason Gerlowski <ge...@apache.org>
AuthorDate: Thu Jan 22 09:13:54 2026 -0500
Fix TestReplicationHandler.testUrlAllowListFailure
Caused by recent changes to how solr.xml is referenced in some tests, in
commit 1245fa.
---
.../src/test/org/apache/solr/handler/ReplicationTestHelper.java | 7 +++++++
.../src/test/org/apache/solr/handler/TestReplicationHandler.java | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java b/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java
index 3051c06802c..6657453a2d9 100644
--- a/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java
+++ b/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java
@@ -27,6 +27,7 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
@@ -61,6 +62,12 @@ public final class ReplicationTestHelper {
+ FileSystems.getDefault().getSeparator();
public static JettySolrRunner createAndStartJetty(SolrInstance instance) throws Exception {
+ Files.copy(
+ SolrTestCaseJ4.TEST_HOME().resolve("solr.xml"),
+ Path.of(instance.getHomeDir(), "solr.xml"),
+ StandardCopyOption.REPLACE_EXISTING);
+ Properties nodeProperties = new Properties();
+ nodeProperties.setProperty("solr.data.dir", instance.getDataDir());
JettyConfig jettyConfig = JettyConfig.builder().setPort(0).build();
JettySolrRunner jetty =
new JettySolrRunner(instance.getHomeDir(), new Properties(), jettyConfig);
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
index b927b918023..11202518ebb 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
@@ -255,7 +255,7 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
public void testUrlAllowList() throws Exception {
// Run another test with URL allow-list enabled and allow-list is empty.
// Expect an exception because the leader URL is not allowed.
- systemClearPropertySolrEnableUrlAllowList();
+ systemSetPropertyEnableUrlAllowList(true);
SolrException e = expectThrows(SolrException.class, this::doTestDetails);
assertTrue(
e.getMessage()