Skip to content
Permalink
Browse files

Fix TestCloudSearcherWarming to work around SOLR-13490

Also clean up some crufty System.out/System.err pollution
  • Loading branch information...
hossman committed May 25, 2019
1 parent 46060d8 commit af4e1d324a389bac8cfcbffcbef20d4647957a61
Showing with 6 additions and 4 deletions.
  1. +6 −4 solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java
@@ -114,9 +114,12 @@ public void testRepFactor1LeaderStartup() throws Exception {

JettySolrRunner runner = cluster.getJettySolrRunner(0);
runner.stop();
waitForState("jetty count:" + cluster.getJettySolrRunners().size(), collectionName, clusterShape(1, 0));

cluster.waitForJettyToStop(runner);
// check waitForState only after we are sure the node has shutdown and have forced an update to liveNodes
// ie: workaround SOLR-13490
cluster.getSolrClient().getZkStateReader().updateLiveNodes();
waitForState("jetty count:" + cluster.getJettySolrRunners().size(), collectionName, clusterShape(1, 0));

// restart
sleepTime.set(1000);
@@ -302,8 +305,7 @@ public boolean onStateChanged(Set<String> liveNodes, DocCollection collectionSta
public static class SleepingSolrEventListener implements SolrEventListener {
@Override
public void init(NamedList args) {
new RuntimeException().printStackTrace();
System.out.println(args);
// No-Op
}

@Override
@@ -325,7 +327,7 @@ public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher current
try {
Thread.sleep(sleepTime.get());
} catch (InterruptedException e) {
e.printStackTrace();
log.warn("newSearcher was interupdated", e);
}
log.info("Finished sleeping for {} on newSearcher: {}, currentSearcher: {} belonging to (newest) core: {}, id: {}", sleepTime.get(), newSearcher, currentSearcher, newSearcher.getCore().getName(), newSearcher.getCore());
}

0 comments on commit af4e1d3

Please sign in to comment.
You can’t perform that action at this time.