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 2017/07/22 16:19:45 UTC

[1/5] curator git commit: testSessionSurvives is a bit flakey. Add a connection state listener to make it less timing dependent

Repository: curator
Updated Branches:
  refs/heads/CURATOR-426 0f493b975 -> e819268dc


testSessionSurvives is a bit flakey. Add a connection state listener to make it less timing dependent


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

Branch: refs/heads/CURATOR-426
Commit: 9f601cc15fc475eabe96fff2e0a915eadf08f748
Parents: 0f493b9
Author: randgalt <ra...@apache.org>
Authored: Fri Jul 21 22:23:35 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri Jul 21 22:23:35 2017 -0500

----------------------------------------------------------------------
 .../curator/framework/imps/TestWithCluster.java     | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/9f601cc1/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWithCluster.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWithCluster.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWithCluster.java
index e846020..c8050de 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWithCluster.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWithCluster.java
@@ -48,6 +48,20 @@ public class TestWithCluster
             client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new ExponentialBackoffRetry(100, 3));
             client.start();
 
+            final CountDownLatch reconnectedLatch = new CountDownLatch(1);
+            ConnectionStateListener listener = new ConnectionStateListener()
+            {
+                @Override
+                public void stateChanged(CuratorFramework client, ConnectionState newState)
+                {
+                    if ( newState == ConnectionState.RECONNECTED )
+                    {
+                        reconnectedLatch.countDown();;
+                    }
+                }
+            };
+            client.getConnectionStateListenable().addListener(listener);
+
             client.create().withMode(CreateMode.EPHEMERAL).forPath("/temp", "value".getBytes());
             Assert.assertNotNull(client.checkExists().forPath("/temp"));
 
@@ -59,7 +73,7 @@ public class TestWithCluster
                 timing.sleepABit();
             }
 
-            timing.sleepABit();
+            Assert.assertTrue(timing.awaitLatch(reconnectedLatch));
             Assert.assertNotNull(client.checkExists().forPath("/temp"));
         }
         finally


[4/5] curator git commit: It seems that, for classic connection, the first events are SUSPENDED/LOST, How did this ever work?

Posted by ra...@apache.org.
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 <ra...@apache.org>
Authored: Sat Jul 22 10:47:55 2017 -0500
Committer: randgalt <ra...@apache.org>
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");


[3/5] curator git commit: when retrying, output the offending exception

Posted by ra...@apache.org.
when retrying, output the offending exception


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

Branch: refs/heads/CURATOR-426
Commit: 4ce1f9d018227a03523e0e973cb1571a17a5ee5d
Parents: 4bc6063
Author: randgalt <ra...@apache.org>
Authored: Sat Jul 22 10:47:36 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jul 22 10:47:36 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/test/BaseClassForTests.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/4ce1f9d0/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
index 8238c82..1c87be4 100644
--- a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
+++ b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
@@ -41,7 +41,6 @@ public class BaseClassForTests
     protected TestingServer server;
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private static final int RETRY_WAIT_MS = 5000;
     private static final String INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES;
     private static final String INTERNAL_PROPERTY_REMOVE_WATCHERS_IN_FOREGROUND;
     private static final String INTERNAL_PROPERTY_VALIDATE_NAMESPACE_WATCHER_MAP_EMPTY;
@@ -167,7 +166,14 @@ public class BaseClassForTests
                 return false;
             }
 
-            log.error("Retrying 1 time");
+            if ( result.getThrowable() != null )
+            {
+                log.error("Retrying 1 time", result.getThrowable());
+            }
+            else
+            {
+                log.error("Retrying 1 time");
+            }
             retryContext.isRetrying.set(true);
             return true;
         }


[2/5] curator git commit: Maven's incremental compiler was messing up some of the classes that are copied from curator-test. So, turn it off for this module

Posted by ra...@apache.org.
Maven's incremental compiler was messing up some of the classes that are copied from curator-test. So, turn it off for this module


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

Branch: refs/heads/CURATOR-426
Commit: 4bc6063757cc5aa4d2a7f6bf9c42110f266f82b9
Parents: 9f601cc
Author: randgalt <ra...@apache.org>
Authored: Sat Jul 22 01:10:15 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jul 22 01:10:15 2017 -0500

----------------------------------------------------------------------
 curator-test-zk34/pom.xml | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/4bc60637/curator-test-zk34/pom.xml
----------------------------------------------------------------------
diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml
index 3cd9946..3ec50cc 100644
--- a/curator-test-zk34/pom.xml
+++ b/curator-test-zk34/pom.xml
@@ -139,6 +139,14 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <useIncrementalCompilation>false</useIncrementalCompilation>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-deploy-plugin</artifactId>
                 <executions>
                     <execution>


[5/5] curator git commit: doh - filterIsSetLatch has to be reset for each iteration (in setup). I can't be a final field

Posted by ra...@apache.org.
doh - filterIsSetLatch has to be reset for each iteration (in setup). I can't be a final field


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

Branch: refs/heads/CURATOR-426
Commit: e819268dc30703ed251a78e8ab769c85b6afb17f
Parents: 73cdf16
Author: randgalt <ra...@apache.org>
Authored: Sat Jul 22 11:19:37 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Jul 22 11:19:37 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/x/async/migrations/TestMigrationManager.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e819268d/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java b/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
index bc724f5..6cc7fd1 100644
--- a/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
+++ b/curator-x-async/src/test/java/org/apache/curator/x/async/migrations/TestMigrationManager.java
@@ -67,7 +67,7 @@ public class TestMigrationManager extends CompletableBaseClassForTests
     private CuratorOp v3op;
     private MigrationManager manager;
     private final AtomicReference<CountDownLatch> filterLatch = new AtomicReference<>();
-    private final CountDownLatch filterIsSetLatch = new CountDownLatch(1);
+    private CountDownLatch filterIsSetLatch;
 
     @BeforeMethod
     @Override
@@ -75,6 +75,8 @@ public class TestMigrationManager extends CompletableBaseClassForTests
     {
         super.setup();
 
+        filterIsSetLatch = new CountDownLatch(1);
+
         CuratorFramework rawClient = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(100));
         rawClient.start();