madrob commented on a change in pull request #1759:
URL: https://github.com/apache/lucene-solr/pull/1759#discussion_r474835389



##########
File path: 
solr/core/src/test/org/apache/solr/cloud/api/collections/SimpleCollectionCreateDeleteTest.java
##########
@@ -32,69 +28,151 @@
 import org.apache.solr.util.TimeOut;
 import org.junit.Test;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
 public class SimpleCollectionCreateDeleteTest extends 
AbstractFullDistribZkTestBase {
 
-  public SimpleCollectionCreateDeleteTest() {
-    sliceCount = 1;
-  }
-
-  @Test
-  @ShardsFixed(num = 1)
-  public void test() throws Exception {
-    String overseerNode = 
OverseerCollectionConfigSetProcessor.getLeaderNode(cloudClient.getZkStateReader().getZkClient());
-    String notOverseerNode = null;
-    for (CloudJettyRunner cloudJetty : cloudJettys) {
-      if (!overseerNode.equals(cloudJetty.nodeName)) {
-        notOverseerNode = cloudJetty.nodeName;
-        break;
-      }
+    public SimpleCollectionCreateDeleteTest() {
+        sliceCount = 1;
     }
-    String collectionName = "SimpleCollectionCreateDeleteTest";
-    CollectionAdminRequest.Create create = 
CollectionAdminRequest.createCollection(collectionName,1,1)
-            .setCreateNodeSet(overseerNode);
-
-    NamedList<Object> request = create.process(cloudClient).getResponse();
-
-    if (request.get("success") != null) {
-      
assertTrue(cloudClient.getZkStateReader().getZkClient().exists(ZkStateReader.COLLECTIONS_ZKNODE
 + "/" + collectionName, false));
-
-      @SuppressWarnings({"rawtypes"})
-      CollectionAdminRequest delete = 
CollectionAdminRequest.deleteCollection(collectionName);
-      cloudClient.request(delete);
-
-      
assertFalse(cloudClient.getZkStateReader().getZkClient().exists(ZkStateReader.COLLECTIONS_ZKNODE
 + "/" + collectionName, false));
-      
-      // currently, removing a collection does not wait for cores to be 
unloaded
-      TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, 
TimeSource.NANO_TIME);
-      while (true) {
-        
-        if( timeout.hasTimedOut() ) {
-          throw new TimeoutException("Timed out waiting for all collections to 
be fully removed.");
+
+    @Test
+    @ShardsFixed(num = 1)
+    public void testCreateAndDeleteThenCreateAgain() throws Exception {

Review comment:
       👍 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to