It seems that, for classic connection, the first events are SUSPENDED/LOST, How 
did this ever work?


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/73cdf160
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/73cdf160
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/73cdf160

Branch: refs/heads/CURATOR-426
Commit: 73cdf1608460c8187928febcd3829ad4ebec8951
Parents: 4ce1f9d
Author: randgalt <[email protected]>
Authored: Sat Jul 22 10:47:55 2017 -0500
Committer: randgalt <[email protected]>
Committed: Sat Jul 22 10:47:55 2017 -0500

----------------------------------------------------------------------
 .../client/TestResetConnectionWithBackgroundFailure.java        | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/73cdf160/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
----------------------------------------------------------------------
diff --git 
a/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
 
b/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
index 852d9aa..bfc9cf4 100644
--- 
a/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
+++ 
b/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
@@ -86,6 +86,11 @@ public class TestResetConnectionWithBackgroundFailure 
extends BaseClassForTests
             client.getConnectionStateListenable().addListener(listener1);
             log.debug("Starting ZK server");
             server.restart();
+            if ( Boolean.getBoolean("curator-use-classic-connection-handling") 
)
+            {
+                
Assert.assertEquals(listenerSequence.poll(forWaiting.milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.SUSPENDED);
+                
Assert.assertEquals(listenerSequence.poll(forWaiting.milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.LOST);
+            }
             
Assert.assertEquals(listenerSequence.poll(forWaiting.milliseconds(), 
TimeUnit.MILLISECONDS), ConnectionState.CONNECTED);
 
             log.debug("Stopping ZK server");

Reply via email to