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/04/19 19:55:09 UTC

[curator] branch CURATOR-559-fix-nested-retry-loops-reopen created (now 320b6e1)

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

randgalt pushed a change to branch CURATOR-559-fix-nested-retry-loops-reopen
in repository https://gitbox.apache.org/repos/asf/curator.git.


      at 320b6e1  CURATOR-559 - more attempts to keep tests from failing. Make sure count is zeroed after server is stopped.

This branch includes the following new commits:

     new 320b6e1  CURATOR-559 - more attempts to keep tests from failing. Make sure count is zeroed after server is stopped.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[curator] 01/01: CURATOR-559 - more attempts to keep tests from failing. Make sure count is zeroed after server is stopped.

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

randgalt pushed a commit to branch CURATOR-559-fix-nested-retry-loops-reopen
in repository https://gitbox.apache.org/repos/asf/curator.git

commit 320b6e1d76493ca8c82df6ea30bbeb1f272960ee
Author: randgalt <ra...@apache.org>
AuthorDate: Sun Apr 19 14:54:04 2020 -0500

    CURATOR-559 - more attempts to keep tests from failing. Make sure count is zeroed after server is stopped.
---
 .../org/apache/curator/connection/TestThreadLocalRetryLoop.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/curator-recipes/src/test/java/org/apache/curator/connection/TestThreadLocalRetryLoop.java b/curator-recipes/src/test/java/org/apache/curator/connection/TestThreadLocalRetryLoop.java
index 56362e6..686109c 100644
--- a/curator-recipes/src/test/java/org/apache/curator/connection/TestThreadLocalRetryLoop.java
+++ b/curator-recipes/src/test/java/org/apache/curator/connection/TestThreadLocalRetryLoop.java
@@ -44,7 +44,7 @@ public class TestThreadLocalRetryLoop extends CuratorTestBase
         AtomicInteger count = new AtomicInteger();
         try (CuratorFramework client = newClient(count))
         {
-            prep(client);
+            prep(client, count);
             doOperation(client);
             Assert.assertEquals(count.get(), retryCount + 1);    // Curator's retry policy has been off by 1 since inception - we might consider fixing it someday
         }
@@ -58,7 +58,7 @@ public class TestThreadLocalRetryLoop extends CuratorTestBase
         AtomicInteger count = new AtomicInteger();
         try (CuratorFramework client = newClient(count))
         {
-            prep(client);
+            prep(client, count);
             for ( int i = 0; i < threadQty; ++i )
             {
                 executorService.submit(() -> doOperation(client));
@@ -82,7 +82,7 @@ public class TestThreadLocalRetryLoop extends CuratorTestBase
         return CuratorFrameworkFactory.newClient(server.getConnectString(), 100, 100, retryPolicy);
     }
 
-    private void prep(CuratorFramework client) throws Exception
+    private void prep(CuratorFramework client, AtomicInteger count) throws Exception
     {
         client.start();
         client.create().forPath("/test");
@@ -94,6 +94,7 @@ public class TestThreadLocalRetryLoop extends CuratorTestBase
         });
         server.stop();
         Assert.assertTrue(timing.awaitLatch(lostLatch));
+        count.set(0);   // in case the server shutdown incremented the count
     }
 
     private Void doOperation(CuratorFramework client) throws Exception