From d5022251d11fb065c24fd47ffd1611f6a5135f94 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Sat, 9 Aug 2008 16:12:24 +0000 Subject: [PATCH] wait until searcher has been registered git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@684284 13f79535-47bb-0310-9956-ffa450edef68 --- src/test/org/apache/solr/core/TestJmxIntegration.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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));