ConnectionStateListener should be added before starting the client CURATOR-455
authorrandgalt <randgalt@apache.org>
Thu, 22 Feb 2018 04:56:36 +0000 (23:56 -0500)
committerrandgalt <randgalt@apache.org>
Thu, 22 Feb 2018 04:56:36 +0000 (23:56 -0500)
curator-framework/src/test/java/org/apache/curator/framework/ensemble/TestEnsembleProvider.java

index 73d94a5..19d65a4 100644 (file)
@@ -62,8 +62,6 @@ public class TestEnsembleProvider extends BaseClassForTests
         final CuratorFramework client = newClient(counter);
         try
         {
-            client.start();
-
             final CountDownLatch connectedLatch = new CountDownLatch(1);
             final CountDownLatch lostLatch = new CountDownLatch(1);
             final CountDownLatch reconnectedLatch = new CountDownLatch(1);
@@ -87,6 +85,8 @@ public class TestEnsembleProvider extends BaseClassForTests
                 }
             };
             client.getConnectionStateListenable().addListener(listener);
+            client.start();
+
             Assert.assertTrue(timing.awaitLatch(connectedLatch));
 
             server.stop();