You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2021/02/22 00:34:40 UTC
[lucene-solr] branch reference_impl_dev updated: @1377 Test
hardening.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl_dev by this push:
new f4d675a @1377 Test hardening.
f4d675a is described below
commit f4d675a78c9c717a3ccf7c88aa074101c04aa64b
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Feb 21 18:34:21 2021 -0600
@1377 Test hardening.
Took 12 minutes
---
.../java/org/apache/solr/update/SolrCmdDistributor.java | 5 +++++
.../test/org/apache/solr/core/TestMergePolicyConfig.java | 16 +++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
index 5a196e1..7189c36 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
@@ -470,6 +470,11 @@ public class SolrCmdDistributor implements Closeable {
this.shardId = shardId;
this.retry = maxRetries > 0;
this.maxRetries = maxRetries;
+ if (nodeProps == null) {
+ SolrException e = new SolrException(SolrException.ErrorCode.SERVER_ERROR, "nodeProps cannot be null");
+ log.error("nodeProps cannot be null", e);
+ throw e;
+ }
}
public String getCollection() {
diff --git a/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java b/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
index 7dbaf96..f8b2691 100644
--- a/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
@@ -47,7 +47,6 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
@After
public void tearDown() throws Exception {
- deleteCore();
super.tearDown();
}
@@ -55,7 +54,7 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
final boolean useCompoundFile = random().nextBoolean();
System.setProperty("testSetNoCFSMergePolicyConfig.useCompoundFile", String.valueOf(useCompoundFile));
- initCore("solrconfig-mergepolicyfactory-nocfs.xml","schema-minimal.xml");
+ initCore("solrconfig-mergepolicyfactory-nocfs.xml","schema-minimal.xml");
try (SolrCore core = h.getCore()) {
IndexWriterConfig iwc = solrConfig.indexConfig.toIndexWriterConfig(core);
assertEquals(useCompoundFile, iwc.getUseCompoundFile());
@@ -77,6 +76,8 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
assertCommitSomeNewDocs();
assertCompoundSegments(core, false);
+ } finally {
+ deleteCore();
}
}
@@ -95,6 +96,8 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
assertCommitSomeNewDocs();
assertCompoundSegments(core, expectCFS);
+ } finally {
+ deleteCore();
}
}
@@ -133,6 +136,8 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
assertNumSegments(core, 1);
// we've now forced a merge, and the MP ratio should be in play
assertCompoundSegments(core, false);
+ } finally {
+ deleteCore();
}
}
@@ -150,8 +155,9 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
assertU(optimize());
assertNumSegments(core, 2);
+ } finally {
+ deleteCore();
}
- deleteCore();
initCore("solrconfig-nomergepolicyfactory.xml", "schema-minimal.xml");
try (SolrCore core = h.getCore()) {
@@ -166,6 +172,8 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
SolrTestCaseUtil.expectThrows(IllegalArgumentException.class, () -> {
updater.commit(cmtCmd);
});
+ } finally {
+ deleteCore();
}
}
@@ -198,6 +206,8 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
assertEquals(11, logMP.getMergeFactor());
assertEquals(456, logMP.getMaxMergeDocs());
+ } finally {
+ deleteCore();
}
}