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/01/12 02:45:01 UTC
[1/2] curator git commit: Move to latest TestNg and try to improve
test retries
Repository: curator
Updated Branches:
refs/heads/CURATOR-3.0 f64519073 -> 540cd28a3
Move to latest TestNg and try to improve test retries
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2342578f
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2342578f
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2342578f
Branch: refs/heads/CURATOR-3.0
Commit: 2342578f424230ee9dd0abfd47f0042f9c422343
Parents: 0ad09eb
Author: randgalt <ra...@apache.org>
Authored: Wed Jan 11 19:52:23 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Jan 11 19:52:23 2017 -0500
----------------------------------------------------------------------
.../org/apache/curator/utils/DebugUtils.java | 1 -
.../recipes/leader/TestLeaderSelector.java | 2 +-
.../leader/TestLeaderSelectorParticipants.java | 2 +-
.../apache/curator/test/BaseClassForTests.java | 28 ++++++--------------
pom.xml | 2 +-
5 files changed, 11 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/2342578f/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 b098989..ce751ec 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
@@ -23,7 +23,6 @@ public class DebugUtils
public static final String PROPERTY_LOG_EVENTS = "curator-log-events";
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_RETRY_FAILED_TESTS = "curator-retry-failed-tests";
private DebugUtils()
{
http://git-wip-us.apache.org/repos/asf/curator/blob/2342578f/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
index c7f415c..e072c30 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
@@ -20,6 +20,7 @@
package org.apache.curator.framework.recipes.leader;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.state.ConnectionState;
@@ -32,7 +33,6 @@ import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
-import org.testng.internal.annotations.Sets;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
http://git-wip-us.apache.org/repos/asf/curator/blob/2342578f/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
index d7329ab..e026f87 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
@@ -19,6 +19,7 @@
package org.apache.curator.framework.recipes.leader;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
@@ -27,7 +28,6 @@ import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
import org.testng.Assert;
import org.testng.annotations.Test;
-import org.testng.internal.annotations.Sets;
import java.util.Collection;
import java.util.List;
import java.util.Set;
http://git-wip-us.apache.org/repos/asf/curator/blob/2342578f/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 13c3138..2de0099 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
@@ -27,15 +27,12 @@ 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
{
protected TestingServer server;
- private static final int RETRY_WAIT_MS = 5000;
private static final String INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES;
- private static final String INTERNAL_RETRY_FAILED_TESTS;
static
{
String logConnectionIssues = null;
@@ -45,14 +42,12 @@ public class BaseClassForTests
// 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;
}
@BeforeSuite(alwaysRun = true)
@@ -105,27 +100,20 @@ public class BaseClassForTests
private static class RetryTest implements IRetryAnalyzer
{
- private final AtomicBoolean hasBeenRetried = new AtomicBoolean(!Boolean.getBoolean(INTERNAL_RETRY_FAILED_TESTS));
+ private boolean wasRetried = false;
@Override
public boolean retry(ITestResult result)
{
- boolean isRetrying = hasBeenRetried.compareAndSet(false, true);
- if ( isRetrying )
+ if ( result.isSuccess() || wasRetried )
{
- 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;
- }
+ wasRetried = false;
+ return false;
}
- return isRetrying;
+
+ wasRetried = true;
+ System.err.println(String.format("Retry test 1 time. Name: %s - TestName: %s ", result.getName(), result.getTestName()));
+ return true;
}
}
http://git-wip-us.apache.org/repos/asf/curator/blob/2342578f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fb992f0..9814b25 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,7 +76,7 @@
<scannotation-version>1.0.2</scannotation-version>
<resteasy-jaxrs-version>2.3.0.GA</resteasy-jaxrs-version>
<guava-version>16.0.1</guava-version>
- <testng-version>6.8.8</testng-version>
+ <testng-version>6.10</testng-version>
<swift-version>0.12.0</swift-version>
<dropwizard-version>0.7.0</dropwizard-version>
<maven-shade-plugin-version>2.3</maven-shade-plugin-version>
[2/2] curator git commit: Merge branch 'master' into CURATOR-3.0
Posted by ra...@apache.org.
Merge branch 'master' into CURATOR-3.0
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/540cd28a
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/540cd28a
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/540cd28a
Branch: refs/heads/CURATOR-3.0
Commit: 540cd28a33bccc6423765851631a02dcd974b89f
Parents: f645190 2342578
Author: randgalt <ra...@apache.org>
Authored: Wed Jan 11 21:44:46 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Jan 11 21:44:46 2017 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/curator/utils/DebugUtils.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/540cd28a/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
----------------------------------------------------------------------
diff --cc curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
index beea726,ce751ec..45eea22
--- a/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
+++ b/curator-client/src/main/java/org/apache/curator/utils/DebugUtils.java
@@@ -21,12 -20,10 +21,13 @@@ package org.apache.curator.utils
public class DebugUtils
{
- public static final String PROPERTY_LOG_EVENTS = "curator-log-events";
- 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_LOG_EVENTS = "curator-log-events";
+ 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_VALIDATE_NAMESPACE_WATCHER_MAP_EMPTY = "curator-validate-namespace-watcher-map-empty";
+
+
private DebugUtils()
{
}