wait until searcher has been registered

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@684284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-08-09 16:12:24 +00:00
parent 261ebe8a07
commit d5022251d1
1 changed files with 8 additions and 1 deletions

View File

@ -86,7 +86,14 @@ public class TestJmxIntegration extends AbstractSolrTestCase {
System.err.println("Servers in testJmxUpdate: " + servers);
System.err.println(h.getCore().getInfoRegistry());
ObjectName searcher = getObjectName("searcher", h.getCore().getInfoRegistry().get("searcher"));
ObjectName searcher = null;
// wait until searcher is registered
for (int i=0; i<100; i++) {
searcher = getObjectName("searcher", h.getCore().getInfoRegistry().get("searcher"));
if (searcher != null) break;
Thread.sleep(250);
}
if (searcher==null) throw new RuntimeException("searcher was never registered");
MBeanServer mbeanServer = servers.get(0);
System.err.println("Mbeans in server: " + mbeanServer.queryNames(null, null));