mirror of https://github.com/apache/lucene.git
SOLR-14128: SystemCollectionCompatTest - increase logging to aid in debuging future (jenkins) failures
(cherry picked from commit bc2770ebb8
)
This commit is contained in:
parent
fb6e2d16de
commit
22fe38f060
|
@ -124,6 +124,7 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void doAfter() throws Exception {
|
public void doAfter() throws Exception {
|
||||||
|
log.info("doAfter: deleting all collections...");
|
||||||
cluster.deleteAllCollections();
|
cluster.deleteAllCollections();
|
||||||
|
|
||||||
if (null != solrClient) {
|
if (null != solrClient) {
|
||||||
|
@ -149,14 +150,13 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
|
||||||
CollectionAdminResponse adminResponse = status.process(solrClient);
|
CollectionAdminResponse adminResponse = status.process(solrClient);
|
||||||
NamedList<Object> response = adminResponse.getResponse();
|
NamedList<Object> response = adminResponse.getResponse();
|
||||||
String leader = (String) response.get("leader");
|
String leader = (String) response.get("leader");
|
||||||
|
log.info("Overseer Status indicates that the overseer is: {}");
|
||||||
JettySolrRunner overseerNode = null;
|
JettySolrRunner overseerNode = null;
|
||||||
int index = -1;
|
|
||||||
List<JettySolrRunner> jettySolrRunners = cluster.getJettySolrRunners();
|
List<JettySolrRunner> jettySolrRunners = cluster.getJettySolrRunners();
|
||||||
for (int i = 0; i < jettySolrRunners.size(); i++) {
|
for (int i = 0; i < jettySolrRunners.size(); i++) {
|
||||||
JettySolrRunner runner = jettySolrRunners.get(i);
|
JettySolrRunner runner = jettySolrRunners.get(i);
|
||||||
if (runner.getNodeName().equals(leader)) {
|
if (runner.getNodeName().equals(leader)) {
|
||||||
overseerNode = runner;
|
overseerNode = runner;
|
||||||
index = i;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,13 +167,16 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
|
||||||
watcher.reset();
|
watcher.reset();
|
||||||
|
|
||||||
// restart Overseer to trigger the back-compat check
|
// restart Overseer to trigger the back-compat check
|
||||||
cluster.stopJettySolrRunner(index);
|
log.info("Stopping Overseer Node: {} ({})", overseerNode.getNodeName(), overseerNode.getLocalPort());
|
||||||
|
cluster.stopJettySolrRunner(overseerNode);
|
||||||
|
log.info("Waiting for new overseer election...");
|
||||||
TimeOut timeOut = new TimeOut(30, TimeUnit.SECONDS, cloudManager.getTimeSource());
|
TimeOut timeOut = new TimeOut(30, TimeUnit.SECONDS, cloudManager.getTimeSource());
|
||||||
while (!timeOut.hasTimedOut()) {
|
while (!timeOut.hasTimedOut()) {
|
||||||
adminResponse = status.process(solrClient);
|
adminResponse = status.process(solrClient);
|
||||||
response = adminResponse.getResponse();
|
response = adminResponse.getResponse();
|
||||||
String newLeader = (String) response.get("leader");
|
String newLeader = (String) response.get("leader");
|
||||||
if (newLeader != null && !leader.equals(newLeader)) {
|
if (newLeader != null && !leader.equals(newLeader)) {
|
||||||
|
log.info("...new overseer is: {}", newLeader);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
timeOut.sleep(200);
|
timeOut.sleep(200);
|
||||||
|
@ -185,6 +188,9 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
|
||||||
TimeOut timeOut1 = new TimeOut(60, TimeUnit.SECONDS, cloudManager.getTimeSource());
|
TimeOut timeOut1 = new TimeOut(60, TimeUnit.SECONDS, cloudManager.getTimeSource());
|
||||||
boolean foundWarning = false;
|
boolean foundWarning = false;
|
||||||
boolean foundSchemaWarning = false;
|
boolean foundSchemaWarning = false;
|
||||||
|
|
||||||
|
// TODO: replace this polling logic with a LogWatcher that uses a queue we can await() on...
|
||||||
|
log.info("Polling for log watcher to detect expected log messages...");
|
||||||
while (!timeOut1.hasTimedOut()) {
|
while (!timeOut1.hasTimedOut()) {
|
||||||
timeOut1.sleep(1000);
|
timeOut1.sleep(1000);
|
||||||
SolrDocumentList history = watcher.getHistory(-1, null);
|
SolrDocumentList history = watcher.getHistory(-1, null);
|
||||||
|
@ -193,9 +199,11 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (doc.getFieldValue("message").toString().contains("re-indexing")) {
|
if (doc.getFieldValue("message").toString().contains("re-indexing")) {
|
||||||
|
log.info("Found re-indexing message: {}", doc.getFieldValue("message"));
|
||||||
foundWarning = true;
|
foundWarning = true;
|
||||||
}
|
}
|
||||||
if (doc.getFieldValue("message").toString().contains("timestamp")) {
|
if (doc.getFieldValue("message").toString().contains("timestamp")) {
|
||||||
|
log.info("Found timestamp message: {}", doc.getFieldValue("message"));
|
||||||
foundSchemaWarning = true;
|
foundSchemaWarning = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,9 +211,9 @@ public class SystemCollectionCompatTest extends SolrCloudTestCase {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.info("Done polling log watcher: foundWarning={} foundSchemaWarning={}", foundWarning, foundSchemaWarning);
|
||||||
assertTrue("re-indexing warning not found", foundWarning);
|
assertTrue("re-indexing warning not found", foundWarning);
|
||||||
assertTrue("timestamp field incompatibility warning not found", foundSchemaWarning);
|
assertTrue("timestamp field incompatibility warning not found", foundSchemaWarning);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue