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 2015/10/11 17:44:48 UTC

curator git commit: Remove retry logic. It doesn't work correctly anyway. Maybe revisit later

Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 ff3fbd759 -> a0cb3fa7f


Remove retry logic. It doesn't work correctly anyway. Maybe revisit later


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

Branch: refs/heads/CURATOR-3.0
Commit: a0cb3fa7fc5cfbfe6c596ff1b890864ed421fa92
Parents: ff3fbd7
Author: randgalt <ra...@apache.org>
Authored: Sun Oct 11 10:44:38 2015 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Oct 11 10:44:38 2015 -0500

----------------------------------------------------------------------
 .../org/apache/curator/utils/DebugUtils.java    |  1 -
 .../apache/curator/test/BaseClassForTests.java  | 35 --------------------
 2 files changed, 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/a0cb3fa7/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java b/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
index 3e90600..03f6903 100644
--- a/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
+++ b/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
@@ -25,7 +25,6 @@ public class DebugUtils
     public static final String PROPERTY_DONT_LOG_CONNECTION_ISSUES = "curator-dont-log-connection-problems";
     public static final String PROPERTY_LOG_ONLY_FIRST_CONNECTION_ISSUE_AS_ERROR_LEVEL = "curator-log-only-first-connection-issue-as-error-level";
     public static final String PROPERTY_REMOVE_WATCHERS_IN_FOREGROUND = "curator-remove-watchers-in-foreground";
-    public static final String PROPERTY_RETRY_FAILED_TESTS = "curator-retry-failed-tests";
 
     private DebugUtils()
     {

http://git-wip-us.apache.org/repos/asf/curator/blob/a0cb3fa7/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 d6feca4..da1607c 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
@@ -19,12 +19,10 @@
 
 package org.apache.curator.test;
 
-import org.apache.zookeeper.server.ServerCnxnFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.IInvokedMethod;
 import org.testng.IInvokedMethodListener;
-import org.testng.IRetryAnalyzer;
 import org.testng.ITestContext;
 import org.testng.ITestNGListener;
 import org.testng.ITestNGMethod;
@@ -34,7 +32,6 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.BeforeSuite;
 import java.io.IOException;
 import java.net.BindException;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 public class BaseClassForTests
 {
@@ -44,25 +41,21 @@ public class BaseClassForTests
     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_RETRY_FAILED_TESTS;
 
     static
     {
         String logConnectionIssues = null;
-        String retryFailedTests = null;
         try
         {
             // use reflection to avoid adding a circular dependency in the pom
             Class<?> debugUtilsClazz = Class.forName("org.apache.curator.utils.DebugUtils");
             logConnectionIssues = (String)debugUtilsClazz.getField("PROPERTY_DONT_LOG_CONNECTION_ISSUES").get(null);
-            retryFailedTests = (String)debugUtilsClazz.getField("PROPERTY_RETRY_FAILED_TESTS").get(null);
         }
         catch ( Exception e )
         {
             e.printStackTrace();
         }
         INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES = logConnectionIssues;
-        INTERNAL_RETRY_FAILED_TESTS = retryFailedTests;
         String s = null;
         try
         {
@@ -103,7 +96,6 @@ public class BaseClassForTests
         for ( ITestNGMethod method : context.getAllTestMethods() )
         {
             method.setInvocationCount(enabledSessionExpiredStateAware() ? 1 : 2);
-            method.setRetryAnalyzer(new RetryTest());
         }
     }
 
@@ -155,31 +147,4 @@ public class BaseClassForTests
     {
         return false;
     }
-
-    private static class RetryTest implements IRetryAnalyzer
-    {
-        private final AtomicBoolean hasBeenRetried = new AtomicBoolean(!Boolean.getBoolean(INTERNAL_RETRY_FAILED_TESTS));
-
-        @Override
-        public boolean retry(ITestResult result)
-        {
-            boolean isRetrying = hasBeenRetried.compareAndSet(false, true);
-            if ( isRetrying )
-            {
-                System.err.println(String.format("Waiting " + RETRY_WAIT_MS + " ms and retrying test. Name: %s - TestName: %s ", result.getName(), result.getTestName()));
-                try
-                {
-                    Thread.sleep(RETRY_WAIT_MS);
-                }
-                catch ( InterruptedException e )
-                {
-                    System.err.println(String.format("Retry interrupted. Name: %s - TestName: %s ", result.getName(), result.getTestName()));
-                    Thread.currentThread().interrupt();
-                    isRetrying = false;
-                }
-            }
-            return isRetrying;
-        }
-    }
-
 }