Skip to content

Commit

Permalink
Fix TestReplicationHandler (apache#3142)
Browse files Browse the repository at this point in the history
Addresses a combination of SOLR-17306 and SOLR-17548.
  • Loading branch information
HoustonPutman authored Jan 29, 2025
1 parent 3be16e2 commit a5b0b98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.nio.charset.StandardCharsets;
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;
Expand Down Expand Up @@ -56,7 +57,8 @@ public final class ReplicationTestHelper {
public static JettySolrRunner createAndStartJetty(SolrInstance instance) throws Exception {
Files.copy(
Path.of(SolrTestCaseJ4.TEST_HOME(), "solr.xml"),
Path.of(instance.getHomeDir(), "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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.StandardDirectoryFactory;
import org.apache.solr.core.snapshots.SolrSnapshotMetaDataManager;
import org.apache.solr.embedded.JettySolrRunner;
import org.apache.solr.handler.admin.api.ReplicationAPIBase;
import org.apache.solr.security.AllowListUrlChecker;
Expand Down Expand Up @@ -1037,8 +1036,7 @@ private int indexDirCount(String ddir) {
@Override
public boolean accept(File dir, String name) {
File f = new File(dir, name);
return f.isDirectory()
&& !SolrSnapshotMetaDataManager.SNAPSHOT_METADATA_DIR.equals(name);
return f.isDirectory() && !name.startsWith("snapshot");
}
});
return list.length;
Expand Down

0 comments on commit a5b0b98

Please sign in to comment.