diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java index 79dd0197ba6..3bf70215701 100644 --- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java @@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.TestUtil; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrRequest; @@ -64,6 +65,7 @@ import static org.apache.solr.common.cloud.ZkStateReader.SOLR_AUTOSCALING_CONF_P * */ @LogLevel("org.apache.solr.cloud.autoscaling=DEBUG") +@LuceneTestCase.AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12181") public class IndexSizeTriggerTest extends SolrCloudTestCase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java index 9b3782ad5ca..12aa9c1a983 100644 --- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java +++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java @@ -1049,9 +1049,14 @@ public class SimClusterStateProvider implements ClusterStateProvider { for (String id : deletes) { Slice s = router.getTargetSlice(id, null, null, req.getParams(), coll); // NOTE: we don't use getProperty because it uses PROPERTY_PROP_PREFIX - String numDocsStr = s.getLeader().getStr("SEARCHER.searcher.numDocs"); + Replica leader = s.getLeader(); + if (leader == null) { + LOG.debug("-- no leader in " + s); + continue; + } + String numDocsStr = leader.getStr("SEARCHER.searcher.numDocs"); if (numDocsStr == null) { - LOG.debug("-- no docs in " + s.getLeader()); + LOG.debug("-- no docs in " + leader); continue; } long numDocs = Long.parseLong(numDocsStr);