You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/10/17 22:06:43 UTC

[lucene-solr] branch reference_impl_dev updated: @1025 Enable test.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new 0b10e6d  @1025 Enable test.
0b10e6d is described below

commit 0b10e6df532d026d134bd55fdfe2397eb0de7625
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sat Oct 17 16:58:32 2020 -0500

    @1025 Enable test.
---
 .../java/org/apache/solr/core/CoreContainer.java   | 10 +--
 .../TestCollectionsAPIViaSolrCloudCluster.java     | 84 +++++-----------------
 2 files changed, 22 insertions(+), 72 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 19fc566..3a34937 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -1015,6 +1015,11 @@ public class CoreContainer implements Closeable {
        solrCores.closing();
      }
 
+    log.info("Shutting down CoreContainer instance=" + System.identityHashCode(this));
+
+    if (isZooKeeperAware() && zkSys != null && zkSys.getZkController() != null && !zkSys.getZkController().isDcCalled()) {
+      zkSys.zkController.disconnect();
+    }
 
     // must do before isShutDown=true
     if (isZooKeeperAware()) {
@@ -1027,11 +1032,6 @@ public class CoreContainer implements Closeable {
       }
     }
 
-    log.info("Shutting down CoreContainer instance=" + System.identityHashCode(this));
-
-    if (isZooKeeperAware() && zkSys != null && zkSys.getZkController() != null && !zkSys.getZkController().isDcCalled()) {
-      zkSys.zkController.disconnect();
-    }
 
     try (ParWork closer = new ParWork(this, true)) {
 
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
index 0123e97..8c0d779 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
@@ -225,7 +225,7 @@ public class TestCollectionsAPIViaSolrCloudCluster extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore // nocommit
+  @Nightly
   public void testStopAllStartAll() throws Exception {
 
     final String collectionName = "testStopAllStartAllCollection";
@@ -287,55 +287,19 @@ public class TestCollectionsAPIViaSolrCloudCluster extends SolrCloudTestCase {
     final List<Integer> leaderIndicesList = new ArrayList<>(leaderIndices);
     final List<Integer> followerIndicesList = new ArrayList<>(followerIndices);
 
-    if (TEST_NIGHTLY) {
-      // first stop the followers (in no particular order)
-      Collections.shuffle(followerIndicesList, random());
-      for (Integer ii : followerIndicesList) {
-        if (!leaderIndices.contains(ii)) {
-          cluster.stopJettySolrRunner(jettys.get(ii));
-        }
-      }
-    } else {
-      try (ParWork worker = new ParWork(this)) {
-
-        // first stop the followers (in no particular order)
-        Collections.shuffle(followerIndicesList, random());
-        for (Integer ii : followerIndicesList) {
-          if (!leaderIndices.contains(ii)) {
-            worker.collect("stopJettyFollowers", () -> {
-              try {
-                cluster.stopJettySolrRunner(jettys.get(ii));
-              } catch (Exception e) {
-                throw new RuntimeException(e);
-              }
-            });
-          }
-        }
-      }
-    }
-    if (TEST_NIGHTLY) {
-      // then stop the leaders (again in no particular order)
-      Collections.shuffle(leaderIndicesList, random());
-      for (Integer ii : leaderIndicesList) {
+    // first stop the followers (in no particular order)
+    Collections.shuffle(followerIndicesList, random());
+    for (Integer ii : followerIndicesList) {
+      if (!leaderIndices.contains(ii)) {
         cluster.stopJettySolrRunner(jettys.get(ii));
       }
-    } else {
-      try (ParWork worker = new ParWork(this)) {
-        // first stop the followers (in no particular order)
-        Collections.shuffle(leaderIndicesList, random());
-        for (Integer ii : leaderIndicesList) {
-          worker.collect("stopJettyFollowers", () -> {
-            try {
-              cluster.stopJettySolrRunner(jettys.get(ii));
-            } catch (Exception e) {
-              throw new RuntimeException(e);
-            }
-          });
-        }
-      }
-
     }
 
+    // then stop the leaders (again in no particular order)
+    Collections.shuffle(leaderIndicesList, random());
+    for (Integer ii : leaderIndicesList) {
+      cluster.stopJettySolrRunner(jettys.get(ii));
+    }
 
     // calculate restart order
     final List<Integer> restartIndicesList = new ArrayList<>();
@@ -345,29 +309,15 @@ public class TestCollectionsAPIViaSolrCloudCluster extends SolrCloudTestCase {
     restartIndicesList.addAll(followerIndicesList);
     if (random().nextBoolean()) Collections.shuffle(restartIndicesList, random());
 
-    if (TEST_NIGHTLY) {
-      // and then restart jettys in that order
-      for (Integer ii : restartIndicesList) {
-        final JettySolrRunner jetty = jettys.get(ii);
-        if (!jetty.isRunning()) {
-          cluster.startJettySolrRunner(jetty);
-          assertTrue(jetty.isRunning());
-        }
-      }
-    } else {
-      log.info("START JETTY'S BACK UP");
-      try (ParWork worker = new ParWork(this)) {
-        for (JettySolrRunner jetty : jettys) {
-            worker.collect("startJetties", () -> {
-              try {
-                cluster.startJettySolrRunner(jetty);
-              } catch (Exception e) {
-                throw new RuntimeException(e);
-              }
-            });
-        }
+    // and then restart jettys in that order
+    for (Integer ii : restartIndicesList) {
+      final JettySolrRunner jetty = jettys.get(ii);
+      if (!jetty.isRunning()) {
+        cluster.startJettySolrRunner(jetty);
+        assertTrue(jetty.isRunning());
       }
     }
+
     cluster.waitForActiveCollection(collectionName, numShards, numShards * numReplicas);
 
     // re-query collection