You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by kr...@apache.org on 2022/09/19 19:08:09 UTC
[solr] branch branch_9x updated: SOLR-16408: TestHdfsUpdateLog, TestRecoveryHdfs, and TestRandomCollapseQParserPlugin call SolrTestCaseJ4.teardownTestCases instead of deleteCore (#1003)
This is an automated email from the ASF dual-hosted git repository.
krisden pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 2d9625cbef6 SOLR-16408: TestHdfsUpdateLog, TestRecoveryHdfs, and TestRandomCollapseQParserPlugin call SolrTestCaseJ4.teardownTestCases instead of deleteCore (#1003)
2d9625cbef6 is described below
commit 2d9625cbef661de1942538f4fd7096c91ca69a8b
Author: Kevin Risden <ri...@users.noreply.github.com>
AuthorDate: Mon Sep 19 15:03:08 2022 -0400
SOLR-16408: TestHdfsUpdateLog, TestRecoveryHdfs, and TestRandomCollapseQParserPlugin call SolrTestCaseJ4.teardownTestCases instead of deleteCore (#1003)
---
.../org/apache/solr/search/TestRandomCollapseQParserPlugin.java | 6 +++---
.../hdfs/src/test/org/apache/solr/hdfs/search/TestRecoveryHdfs.java | 5 ++---
.../src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java | 5 ++---
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java
index 62ac2b2b9b2..2385ceeb035 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java
@@ -43,7 +43,7 @@ public class TestRandomCollapseQParserPlugin extends SolrTestCaseJ4 {
public static List<String> ALL_SORT_FIELD_NAMES;
public static List<String> ALL_COLLAPSE_FIELD_NAMES;
- private static String[] NULL_POLICIES =
+ private static final String[] NULL_POLICIES =
new String[] {
CollapsingQParserPlugin.NullPolicy.IGNORE.getName(),
CollapsingQParserPlugin.NullPolicy.COLLAPSE.getName(),
@@ -82,9 +82,9 @@ public class TestRandomCollapseQParserPlugin extends SolrTestCaseJ4 {
@AfterClass
public static void cleanupStatics() {
- deleteCore();
SOLR = null;
- ALL_SORT_FIELD_NAMES = ALL_COLLAPSE_FIELD_NAMES = null;
+ ALL_SORT_FIELD_NAMES = null;
+ ALL_COLLAPSE_FIELD_NAMES = null;
}
public void testEveryIsolatedSortFieldOnSingleGroup() throws Exception {
diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/search/TestRecoveryHdfs.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/search/TestRecoveryHdfs.java
index 739cbe07a79..543f17080dd 100644
--- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/search/TestRecoveryHdfs.java
+++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/search/TestRecoveryHdfs.java
@@ -109,7 +109,8 @@ public class TestRecoveryHdfs extends SolrTestCaseJ4 {
IOUtils.closeQuietly(fs);
fs = null;
try {
- deleteCore();
+ // Make sure to clean up test resources before shutting down HDFS
+ SolrTestCaseJ4.teardownTestCases();
} finally {
try {
HdfsTestUtil.teardownClass(dfsCluster);
@@ -117,8 +118,6 @@ public class TestRecoveryHdfs extends SolrTestCaseJ4 {
dfsCluster = null;
hdfsUri = null;
System.clearProperty("solr.ulog.dir");
- System.clearProperty("test.build.data");
- System.clearProperty("test.cache.data");
}
}
}
diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java
index 154ce5ba97f..4b58b558ec5 100644
--- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java
+++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java
@@ -72,7 +72,8 @@ public class TestHdfsUpdateLog extends SolrTestCaseJ4 {
IOUtils.closeQuietly(fs);
fs = null;
try {
- deleteCore();
+ // Make sure to clean up test resources before shutting down HDFS
+ SolrTestCaseJ4.teardownTestCases();
} finally {
try {
HdfsTestUtil.teardownClass(dfsCluster);
@@ -80,8 +81,6 @@ public class TestHdfsUpdateLog extends SolrTestCaseJ4 {
dfsCluster = null;
hdfsUri = null;
System.clearProperty("solr.ulog.dir");
- System.clearProperty("test.build.data");
- System.clearProperty("test.cache.data");
}
}
}