mirror of https://github.com/apache/lucene.git
fix test so that it does not miss the 2nd event
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1380194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
362d518c19
commit
fe0340cf60
|
@ -18,6 +18,8 @@ package org.apache.solr.cloud;
|
|||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
@ -172,6 +174,7 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
|
|||
AbstractZkTestCase.makeSolrZkNode(server.getZkHost());
|
||||
final SolrZkClient zkClient = new SolrZkClient(server.getZkAddress(), AbstractZkTestCase.TIMEOUT);
|
||||
try {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
zkClient.makePath("/collections", true);
|
||||
|
||||
zkClient.getChildren("/collections", new Watcher() {
|
||||
|
@ -184,6 +187,7 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
|
|||
// remake watch
|
||||
try {
|
||||
zkClient.getChildren("/collections", this, true);
|
||||
latch.countDown();
|
||||
} catch (KeeperException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InterruptedException e) {
|
||||
|
@ -193,6 +197,7 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
|
|||
}, true);
|
||||
|
||||
zkClient.makePath("/collections/collection99/shards", true);
|
||||
latch.await(); //wait until watch has been re-created
|
||||
|
||||
zkClient.makePath("collections/collection99/config=collection1", true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue