Apache Solr open-source search software
SOLR-8046: HdfsCollectionsAPIDistributedZkTest checks that no transaction logs failed to be opened during the test but does not isolate this to the test and could fail due to other tests.
Mark Robert Miller1d80b3678da1
diff --git a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsCollectionsAPIDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsCollectionsAPIDistributedZkTest.javaindex dd2691a12b2..4b09e480e4d 100644--- a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsCollectionsAPIDistributedZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsCollectionsAPIDistributedZkTest.java@@ -37,16 +37,19 @@ import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;})public class HdfsCollectionsAPIDistributedZkTest extends CollectionsAPIDistributedZkTest {private static MiniDFSCluster dfsCluster;+ private static long initialFailLogsCount;@BeforeClasspublic static void setupClass() throws Exception {dfsCluster = HdfsTestUtil.setupClass(createTempDir().toFile().getAbsolutePath());System.setProperty("solr.hdfs.blockcache.enabled", "false");+ initialFailLogsCount = HdfsUpdateLog.INIT_FAILED_LOGS_COUNT.get();}@AfterClasspublic static void teardownClass() throws Exception {- assertEquals(0, HdfsUpdateLog.INIT_FAILED_LOGS_COUNT.get());+ // there should be no new fails from this test+ assertEquals(0, HdfsUpdateLog.INIT_FAILED_LOGS_COUNT.get() - initialFailLogsCount);HdfsTestUtil.teardownClass(dfsCluster);System.clearProperty("solr.hdfs.blockcache.enabled");dfsCluster = null;