Fix TestCloudSearcherWarming to work around SOLR-13490

Also clean up some crufty System.out/System.err pollution
This commit is contained in:
Chris Hostetter 2019-05-25 08:40:04 -07:00
parent 46060d88a2
commit af4e1d324a
1 changed files with 6 additions and 4 deletions

View File

@ -114,9 +114,12 @@ public class TestCloudSearcherWarming extends SolrCloudTestCase {
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 class TestCloudSearcherWarming extends SolrCloudTestCase {
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 class TestCloudSearcherWarming extends SolrCloudTestCase {
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());
}