You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2020/05/09 15:40:09 UTC

[curator] branch master updated: make testParentContainerMissing() more resilient by waiting for initial connection

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

randgalt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git


The following commit(s) were added to refs/heads/master by this push:
     new 82304ea  make testParentContainerMissing() more resilient by waiting for initial connection
82304ea is described below

commit 82304ea4fcf965b2493ddf94d8ab30ef74af9068
Author: randgalt <ra...@apache.org>
AuthorDate: Sat May 9 10:40:03 2020 -0500

    make testParentContainerMissing() more resilient by waiting for initial connection
---
 .../curator/framework/recipes/cache/TestPathChildrenCache.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
index 878ce48..11a25fe 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
@@ -57,7 +57,14 @@ public class TestPathChildrenCache extends BaseClassForTests
         try
         {
             client.start();
-            client.blockUntilConnected();   // avoid PathChildrenCache connected events
+            CountDownLatch startedLatch = new CountDownLatch(1);
+            client.getConnectionStateListenable().addListener((__, newState) -> {
+                if ( newState == ConnectionState.CONNECTED )
+                {
+                    startedLatch.countDown();
+                }
+            });
+            Assert.assertTrue(timing.awaitLatch(startedLatch));
 
             final BlockingQueue<PathChildrenCacheEvent.Type> events = Queues.newLinkedBlockingQueue();
             PathChildrenCacheListener listener = new PathChildrenCacheListener()