SOLR-11407: Add some debugging information when the test fails.

This commit is contained in:
Andrzej Bialecki 2017-09-27 19:25:15 +02:00
parent d47af823ed
commit fba51f34d7
1 changed files with 8 additions and 4 deletions

View File

@ -175,7 +175,9 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
boolean await = actionFiredLatch.await(60, TimeUnit.SECONDS); boolean await = actionFiredLatch.await(60, TimeUnit.SECONDS);
assertTrue("action did not execute", await); assertTrue("action did not execute", await);
// commit on the history collection // commit on the history collection
Thread.sleep(2000);
solrClient.commit(CollectionAdminParams.SYSTEM_COLL); solrClient.commit(CollectionAdminParams.SYSTEM_COLL);
Thread.sleep(2000);
// verify that new docs exist // verify that new docs exist
ModifiableSolrParams query = params(CommonParams.Q, "type:" + SystemLogListener.DOC_TYPE, ModifiableSolrParams query = params(CommonParams.Q, "type:" + SystemLogListener.DOC_TYPE,
CommonParams.FQ, "event.source_s:" + PREFIX + "_node_added_trigger"); CommonParams.FQ, "event.source_s:" + PREFIX + "_node_added_trigger");
@ -185,11 +187,13 @@ public class AutoscalingHistoryHandlerTest extends SolrCloudTestCase {
query = params(CommonParams.QT, CommonParams.AUTOSCALING_HISTORY_PATH, query = params(CommonParams.QT, CommonParams.AUTOSCALING_HISTORY_PATH,
AutoscalingHistoryHandler.TRIGGER_PARAM, PREFIX + "_node_added_trigger"); AutoscalingHistoryHandler.TRIGGER_PARAM, PREFIX + "_node_added_trigger");
docs = solrClient.query(query).getResults(); QueryResponse rsp = solrClient.query(query);
docs = rsp.getResults();
if (docs.size() != 8) { if (docs.size() != 8) {
zkClient().printLayoutToStdOut(); log.info("Cluster state: " + solrClient.getZkStateReader().getClusterState());
query = params(CommonParams.QT, CommonParams.AUTOSCALING_DIAGNOSTICS_PATH); query = params(CommonParams.QT, CommonParams.AUTOSCALING_HISTORY_PATH);
log.info("Diagnostic output: ", solrClient.query(query).getResponse()); log.info("Wrong response: ", rsp);
log.info("Full response: " + solrClient.query(query));
} }
assertEquals(8, docs.size()); assertEquals(8, docs.size());