diff --git a/src/test/org/apache/solr/core/TestJmxIntegration.java b/src/test/org/apache/solr/core/TestJmxIntegration.java index d32ee9f46a5..a308875c0c4 100644 --- a/src/test/org/apache/solr/core/TestJmxIntegration.java +++ b/src/test/org/apache/solr/core/TestJmxIntegration.java @@ -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));