lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1034580 - /lucene/dev/trunk/solr/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java
Date Fri, 12 Nov 2010 21:43:35 GMT
Author: markrmiller
Date: Fri Nov 12 21:43:35 2010
New Revision: 1034580

URL: http://svn.apache.org/viewvc?rev=1034580&view=rev
Log:
make test more robust to slowness

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java?rev=1034580&r1=1034579&r2=1034580&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java Fri Nov
12 21:43:35 2010
@@ -155,16 +155,24 @@ public class CloudStateUpdateTest extend
     SolrCore core = container1.create(dcore);
     container1.register(core, false);
     
-    // slight pause - TODO: takes an oddly long amount of time to schedule tasks
-    // with almost no delay ...
-    Thread.sleep(5000);
-
     ZkController zkController2 = container2.getZkController();
 
     String host = zkController2.getHostName();
-
-    CloudState cloudState2 = zkController2.getCloudState();
-    Map<String,Slice> slices = cloudState2.getSlices("testcore");
+    
+    // slight pause - TODO: takes an oddly long amount of time to schedule tasks
+    // with almost no delay ...
+    Thread.sleep(5000);
+    CloudState cloudState2 = null;
+    Map<String,Slice> slices = null;
+    for (int i = 30; i > 0; i--) {
+      cloudState2 = zkController2.getCloudState();
+      slices = cloudState2.getSlices("testcore");
+      
+      if (slices.containsKey(host + ":1661_solr_testcore")) {
+        break;
+      }
+      Thread.sleep(500);
+    }
 
     assertNotNull(slices);
     assertTrue(slices.containsKey(host + ":1661_solr_testcore"));



Mime
View raw message