SOLR-12181: Fix NPE. Disable the test until it's fixed.

This commit is contained in:
Andrzej Bialecki 2018-04-13 12:44:59 +02:00
parent e851b89cbe
commit dfc05faa35
2 changed files with 9 additions and 2 deletions

View File

@ -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());

View File

@ -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);