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

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new b47c059  Ability to disable test retries from commandline (#1789)
b47c059 is described below

commit b47c05985b199bd862ecbaf21bdf54deccbd4df1
Author: Ivan Kelly <iv...@apache.org>
AuthorDate: Wed May 16 18:04:25 2018 +0200

    Ability to disable test retries from commandline (#1789)
    
    Sometimes it's useful to be able to disable retries when testing
    sometime, for example, if you want to find flakes, or you have a test
    that's failing and you want to dig into why. This patch adds a
    commandline flag, testRetryCount, which can be passed to maven to
    disable retries.
    
    ```
    mvn test -Dtest=SomeTest -DtestRetryCount=0
    ```
---
 buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java | 2 +-
 pom.xml                                                             | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java 
b/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java
index c4caa04..d94e1e2 100644
--- a/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java
+++ b/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java
@@ -26,7 +26,7 @@ public class RetryAnalyzer implements IRetryAnalyzer {
     private int count = 0;
 
     // Only try again once
-    private static final int MAX_RETRIES = 1;
+    private static final int MAX_RETRIES = 
Integer.valueOf(System.getProperty("testRetryCount", "1"));
 
     @Override
     public boolean retry(ITestResult result) {
diff --git a/pom.xml b/pom.xml
index e62168a..814ce61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -117,6 +117,7 @@ flexible messaging model and an intuitive client 
API.</description>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     <redirectTestOutputToFile>true</redirectTestOutputToFile>
     <testRealAWS>false</testRealAWS>
+    <testRetryCount>1</testRetryCount>
 
     <bookkeeper.version>4.7.0</bookkeeper.version>
     <zookeeper.version>3.4.10</zookeeper.version>
@@ -838,6 +839,10 @@ flexible messaging model and an intuitive client 
API.</description>
               <value>${testRealAWS}</value>
             </property>
             <property>
+              <name>testRetryCount</name>
+              <value>${testRetryCount}</value>
+            </property>
+            <property>
               <name>listener</name>
               
<value>org.apache.pulsar.tests.PulsarTestListener,org.apache.pulsar.tests.AnnotationListener</value>
             </property>

-- 
To stop receiving notification emails like this one, please contact
mme...@apache.org.

Reply via email to