Mark some dl tests as flaky

mark some dl tests as flaky and link the corresponding investigation jiras

Author: jiazhai <zhaijia03@gmail.com>

Reviewers: Sijie Guo <sijie@apache.org>

Closes #20 from jiazhai/zhaijia/fix_travis_build
diff --git a/.travis.yml b/.travis.yml
index fb99747..74ff391 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,9 +22,16 @@
     - os: osx
       osx_image: xcode8
 
+before_install:
+  - echo "MAVEN_OPTS='-Xmx3072m -XX:MaxPermSize=512m'" > ~/.mavenrc
+
+install:
+  - travis_retry mvn -B install clean -U -DskipTests=true
+
+script:
+  - travis_retry mvn clean apache-rat:check
+  - travis_wait 60 mvn package
+
 cache:
   directories:
     - $HOME/.m2
-
-script:
-  - mvn clean apache-rat:check package
diff --git a/distributedlog-client/src/test/resources/log4j.properties b/distributedlog-client/src/test/resources/log4j.properties
index d5c3009..2073b17 100644
--- a/distributedlog-client/src/test/resources/log4j.properties
+++ b/distributedlog-client/src/test/resources/log4j.properties
@@ -23,7 +23,7 @@
 #
 
 # Example with rolling log file
-log4j.rootLogger=TRACE, R
+log4j.rootLogger=INFO, CONSOLE
 
 #disable zookeeper logging
 log4j.logger.org.apache.zookeeper=OFF
@@ -31,7 +31,7 @@
 log4j.logger.org.apache.bookkeeper=INFO
 
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=TRACE
+log4j.appender.CONSOLE.Threshold=INFO
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
 
diff --git a/distributedlog-core/src/test/java/com/twitter/distributedlog/TestAsyncReaderWriter.java b/distributedlog-core/src/test/java/com/twitter/distributedlog/TestAsyncReaderWriter.java
index 787f74f..8011a04 100644
--- a/distributedlog-core/src/test/java/com/twitter/distributedlog/TestAsyncReaderWriter.java
+++ b/distributedlog-core/src/test/java/com/twitter/distributedlog/TestAsyncReaderWriter.java
@@ -30,6 +30,7 @@
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import com.twitter.distributedlog.config.ConcurrentBaseConfiguration;
 import com.twitter.distributedlog.config.ConcurrentConstConfiguration;
 import com.twitter.distributedlog.config.DynamicDistributedLogConfiguration;
@@ -44,6 +45,7 @@
 import org.apache.bookkeeper.client.LedgerMetadata;
 import org.apache.bookkeeper.feature.FixedValueFeature;
 import org.apache.bookkeeper.stats.NullStatsLogger;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -808,7 +810,10 @@
 
     /**
      * Test Case: starting reading when the streams don't exist.
+     * {@link https://issues.apache.org/jira/browse/DL-42}
      */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 120000)
     public void testSimpleAsyncReadWriteStartEmptyFactory() throws Exception {
         int count = 50;
@@ -1478,7 +1483,9 @@
         dlm.close();
     }
 
-    @Test(timeout = 10000)
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
+    @Test(timeout = 60000)
     public void testAsyncReadMissingZKNotification() throws Exception {
         String name = "distrlog-async-reader-missing-zk-notification";
         DistributedLogConfiguration confLocal = new DistributedLogConfiguration();
diff --git a/distributedlog-core/src/test/java/com/twitter/distributedlog/TestNonBlockingReads.java b/distributedlog-core/src/test/java/com/twitter/distributedlog/TestNonBlockingReads.java
index 58863c4..1451814 100644
--- a/distributedlog-core/src/test/java/com/twitter/distributedlog/TestNonBlockingReads.java
+++ b/distributedlog-core/src/test/java/com/twitter/distributedlog/TestNonBlockingReads.java
@@ -21,9 +21,11 @@
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import com.twitter.distributedlog.exceptions.IdleReaderException;
 import com.twitter.distributedlog.util.FutureUtils;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -31,6 +33,11 @@
 import static com.twitter.distributedlog.NonBlockingReadsTestUtil.*;
 import static org.junit.Assert.*;
 
+/**
+ * {@link https://issues.apache.org/jira/browse/DL-12}
+ */
+@DistributedLogAnnotations.FlakyTest
+@Ignore
 public class TestNonBlockingReads extends TestDistributedLogBase {
     static final Logger LOG = LoggerFactory.getLogger(TestNonBlockingReads.class);
 
diff --git a/distributedlog-core/src/test/java/com/twitter/distributedlog/TestZooKeeperClient.java b/distributedlog-core/src/test/java/com/twitter/distributedlog/TestZooKeeperClient.java
index 983fb29..33effbc 100644
--- a/distributedlog-core/src/test/java/com/twitter/distributedlog/TestZooKeeperClient.java
+++ b/distributedlog-core/src/test/java/com/twitter/distributedlog/TestZooKeeperClient.java
@@ -19,6 +19,7 @@
 
 import com.twitter.distributedlog.ZooKeeperClient.Credentials;
 import com.twitter.distributedlog.ZooKeeperClient.DigestCredentials;
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import org.apache.bookkeeper.stats.NullStatsLogger;
 import org.apache.bookkeeper.zookeeper.BoundExponentialBackoffRetryPolicy;
 import org.apache.zookeeper.CreateMode;
@@ -32,6 +33,7 @@
 import org.apache.zookeeper.data.Stat;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -249,6 +251,11 @@
         return connected;
     }
 
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-34}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     public void testAclAuthSpansExpiration() throws Exception {
         ZooKeeperClient zkcAuth = buildAuthdClient("test");
@@ -267,6 +274,11 @@
         rmAll(zkcAuth, "/test");
     }
 
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-34}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     public void testAclAuthSpansExpirationNonRetryableClient() throws Exception {
         ZooKeeperClient zkcAuth = clientBuilder().retryPolicy(null).zkAclId("test").build();
diff --git a/distributedlog-core/src/test/java/com/twitter/distributedlog/admin/TestDistributedLogAdmin.java b/distributedlog-core/src/test/java/com/twitter/distributedlog/admin/TestDistributedLogAdmin.java
index a1f9d1d..5e56169 100644
--- a/distributedlog-core/src/test/java/com/twitter/distributedlog/admin/TestDistributedLogAdmin.java
+++ b/distributedlog-core/src/test/java/com/twitter/distributedlog/admin/TestDistributedLogAdmin.java
@@ -21,11 +21,13 @@
 import java.util.concurrent.TimeUnit;
 
 import com.twitter.distributedlog.DistributedLogConfiguration;
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import com.twitter.distributedlog.util.Utils;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.ZooDefs;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -70,7 +72,11 @@
         zooKeeperClient.close();
     }
 
-
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-44}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     @SuppressWarnings("deprecation")
     public void testChangeSequenceNumber() throws Exception {
diff --git a/distributedlog-core/src/test/java/com/twitter/distributedlog/bk/TestLedgerAllocator.java b/distributedlog-core/src/test/java/com/twitter/distributedlog/bk/TestLedgerAllocator.java
index 181310e..3628734 100644
--- a/distributedlog-core/src/test/java/com/twitter/distributedlog/bk/TestLedgerAllocator.java
+++ b/distributedlog-core/src/test/java/com/twitter/distributedlog/bk/TestLedgerAllocator.java
@@ -19,6 +19,7 @@
 
 import com.twitter.distributedlog.BookKeeperClient;
 import com.twitter.distributedlog.BookKeeperClientBuilder;
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import com.twitter.distributedlog.bk.SimpleLedgerAllocator.AllocationException;
 import com.twitter.distributedlog.bk.SimpleLedgerAllocator.Phase;
 import com.twitter.distributedlog.DistributedLogConfiguration;
@@ -45,6 +46,7 @@
 import org.apache.zookeeper.data.Stat;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -121,6 +123,11 @@
         return FutureUtils.result(SimpleLedgerAllocator.of(allocationPath, null, newQuorumConfigProvider(conf), zkc, bkc));
     }
 
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-43}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     public void testAllocation() throws Exception {
         String allocationPath = "/allocation1";
@@ -298,6 +305,11 @@
                 dlConf.getBKDigestPW().getBytes(UTF_8));
     }
 
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-26}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     public void testCloseAllocatorAfterConfirm() throws Exception {
         String allocationPath = "/allocation2";
diff --git a/distributedlog-core/src/test/java/com/twitter/distributedlog/feature/TestDynamicConfigurationFeatureProvider.java b/distributedlog-core/src/test/java/com/twitter/distributedlog/feature/TestDynamicConfigurationFeatureProvider.java
index 46c1880..fc82b6e 100644
--- a/distributedlog-core/src/test/java/com/twitter/distributedlog/feature/TestDynamicConfigurationFeatureProvider.java
+++ b/distributedlog-core/src/test/java/com/twitter/distributedlog/feature/TestDynamicConfigurationFeatureProvider.java
@@ -18,9 +18,11 @@
 package com.twitter.distributedlog.feature;
 
 import com.twitter.distributedlog.DistributedLogConfiguration;
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import com.twitter.distributedlog.config.PropertiesWriter;
 import org.apache.bookkeeper.feature.Feature;
 import org.apache.bookkeeper.stats.NullStatsLogger;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -74,6 +76,11 @@
         provider.stop();
     }
 
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-40}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     public void testLoadFeaturesFromOverlay() throws Exception {
         PropertiesWriter writer = new PropertiesWriter();
diff --git a/distributedlog-core/src/test/resources/log4j.properties b/distributedlog-core/src/test/resources/log4j.properties
index 76f79f6..2073b17 100644
--- a/distributedlog-core/src/test/resources/log4j.properties
+++ b/distributedlog-core/src/test/resources/log4j.properties
@@ -23,7 +23,7 @@
 #
 
 # Example with rolling log file
-log4j.rootLogger=INFO, R
+log4j.rootLogger=INFO, CONSOLE
 
 #disable zookeeper logging
 log4j.logger.org.apache.zookeeper=OFF
@@ -31,7 +31,7 @@
 log4j.logger.org.apache.bookkeeper=INFO
 
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=TRACE
+log4j.appender.CONSOLE.Threshold=INFO
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
 
diff --git a/distributedlog-service/src/test/java/com/twitter/distributedlog/service/TestDistributedLogServer.java b/distributedlog-service/src/test/java/com/twitter/distributedlog/service/TestDistributedLogServer.java
index f207b17..8300797 100644
--- a/distributedlog-service/src/test/java/com/twitter/distributedlog/service/TestDistributedLogServer.java
+++ b/distributedlog-service/src/test/java/com/twitter/distributedlog/service/TestDistributedLogServer.java
@@ -21,6 +21,7 @@
 import com.twitter.distributedlog.DLMTestUtil;
 import com.twitter.distributedlog.DLSN;
 import com.twitter.distributedlog.DistributedLogManager;
+import com.twitter.distributedlog.annotations.DistributedLogAnnotations;
 import com.twitter.distributedlog.exceptions.LogNotFoundException;
 import com.twitter.distributedlog.LogReader;
 import com.twitter.distributedlog.LogRecord;
@@ -49,6 +50,7 @@
 import com.twitter.util.Duration;
 import com.twitter.util.Future;
 import com.twitter.util.Futures;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -78,6 +80,11 @@
     @Rule
     public TestName testName = new TestName();
 
+    /**
+     * {@link https://issues.apache.org/jira/browse/DL-27}
+     */
+    @DistributedLogAnnotations.FlakyTest
+    @Ignore
     @Test(timeout = 60000)
     public void testBasicWrite() throws Exception {
         String name = "dlserver-basic-write";
diff --git a/distributedlog-service/src/test/resources/log4j.properties b/distributedlog-service/src/test/resources/log4j.properties
index 4b79823..2073b17 100644
--- a/distributedlog-service/src/test/resources/log4j.properties
+++ b/distributedlog-service/src/test/resources/log4j.properties
@@ -23,7 +23,7 @@
 #
 
 # Example with rolling log file
-log4j.rootLogger=DEBUG, R
+log4j.rootLogger=INFO, CONSOLE
 
 #disable zookeeper logging
 log4j.logger.org.apache.zookeeper=OFF
@@ -31,7 +31,7 @@
 log4j.logger.org.apache.bookkeeper=INFO
 
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=TRACE
+log4j.appender.CONSOLE.Threshold=INFO
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
 
diff --git a/pom.xml b/pom.xml
index 57f6d1f..fc90d81 100644
--- a/pom.xml
+++ b/pom.xml
@@ -159,7 +159,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.9</version>
+        <version>2.19.1</version>
         <configuration>
           <redirectTestOutputToFile>true</redirectTestOutputToFile>
           <argLine>-Xmx3G -Djava.net.preferIPv4Stack=true -XX:MaxDirectMemorySize=2G</argLine>