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/07/28 18:20:58 UTC

[lucene-solr] branch reference_impl_dev updated (139c2b7 -> 2739516)

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

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


 discard 139c2b7  @431 Enable a couple test methods.
     new 2739516  @431 Enable a test method and remove a silly one, we don't need to test fundamental zk so much.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (139c2b7)
            \
             N -- N -- N   refs/heads/reference_impl_dev (2739516)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/solr/cloud/ZkSolrClientTest.java    | 55 ++--------------------
 1 file changed, 4 insertions(+), 51 deletions(-)


[lucene-solr] 01/01: @431 Enable a test method and remove a silly one, we don't need to test fundamental zk so much.

Posted by ma...@apache.org.
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

commit 27395165b5bbc880b5e34c30135740a846a8a2df
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Jul 28 13:20:32 2020 -0500

    @431 Enable a test method and remove a silly one, we don't need to test fundamental zk so much.
---
 .../org/apache/solr/cloud/ZkSolrClientTest.java    | 65 +++-------------------
 1 file changed, 9 insertions(+), 56 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java b/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java
index f5050a8..30f5639 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java
@@ -19,6 +19,7 @@ package org.apache.solr.cloud;
 import java.nio.file.Path;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -224,59 +225,6 @@ public class ZkSolrClientTest extends SolrTestCaseJ4 {
     }
   }
 
-  @Test
-  @Ignore // nocommit debug
-  public void testMultipleWatchesAsync() throws Exception {
-    try (ZkConnection conn = new ZkConnection()) {
-      final SolrZkClient zkClient = conn.getClient();
-      zkClient.mkdir("/collections");
-
-      final int numColls = random().nextInt(TEST_NIGHTLY ? 100 : 10);
-      final CountDownLatch latch = new CountDownLatch(numColls);
-      final CountDownLatch watchesDone = new CountDownLatch(numColls);
-      final Set<String> collectionsInProgress = new HashSet<>(numColls);
-      AtomicInteger maxCollectionsInProgress = new AtomicInteger();
-
-      for (int i = 1; i <= numColls; i ++) {
-        String collPath = "/collections/collection" + i;
-        zkClient.mkdir(collPath);
-        zkClient.getChildren(collPath, new Watcher() {
-          @Override
-          public void process(WatchedEvent event) {
-            synchronized (collectionsInProgress) {
-              collectionsInProgress.add(event.getPath()); // Will be something like /collections/collection##
-              maxCollectionsInProgress.set(Math.max(maxCollectionsInProgress.get(), collectionsInProgress.size()));
-            }
-            latch.countDown();
-            try {
-              latch.await(10000, TimeUnit.MILLISECONDS);
-            }
-            catch (InterruptedException e) {}
-            synchronized (collectionsInProgress) {
-              collectionsInProgress.remove(event.getPath());
-            }
-            watchesDone.countDown();
-          }
-        }, true);
-      }
-
-      for (int i = 1; i <= numColls; i ++) {
-        String shardsPath = "/collections/collection" + i + "/shards";
-        zkClient.mkdir(shardsPath);
-      }
-
-      assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
-      assertEquals("All collections should have been processed in parallel", numColls, maxCollectionsInProgress.get());
-      
-      // just as sanity check for the test:
-      assertTrue(watchesDone.await(10000, TimeUnit.MILLISECONDS));
-      synchronized (collectionsInProgress) {
-        assertEquals(0, collectionsInProgress.size());
-      }
-    }
-  }
-
-  @Ignore // nocommit - flakey
   public void testWatchChildren() throws Exception {
     try (ZkConnection conn = new ZkConnection ()) {
       final SolrZkClient zkClient = conn.getClient();
@@ -289,6 +237,9 @@ public class ZkSolrClientTest extends SolrTestCaseJ4 {
 
         @Override
         public void process(WatchedEvent event) {
+          if (event.getType().equals(Event.EventType.None)) {
+            return;
+          }
           cnt.incrementAndGet();
           // remake watch
           try {
@@ -300,13 +251,15 @@ public class ZkSolrClientTest extends SolrTestCaseJ4 {
         }
       }, true);
 
+      zkClient.mkdir("/collections/collection99");
       zkClient.mkdir("/collections/collection99/shards");
       latch.await(); //wait until watch has been re-created
 
-      zkClient.mkdir("collections/collection99/config=collection1");
+      zkClient.mkdir("/collections/collection99/config=collection1");
 
-      zkClient.mkdir("collections/collection99/config=collection3");
-      
+      zkClient.mkdir("/collections/collection99/config=collection3");
+
+      zkClient.mkdir("/collections/collection97");
       zkClient.mkdir("/collections/collection97/shards");
 
       assertEquals(2, cnt.intValue());