You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by rg...@apache.org on 2015/06/04 19:38:40 UTC

svn commit: r1683603 - in /zookeeper/branches/branch-3.5: CHANGES.txt src/java/test/org/apache/zookeeper/server/quorum/LearnerSnapshotThrottlerTest.java

Author: rgs
Date: Thu Jun  4 17:38:40 2015
New Revision: 1683603

URL: http://svn.apache.org/r1683603
Log:
ZOOKEEPER-2204: LearnerSnapshotThrottlerTest.testHighContentionWithTimeout
fails occasionally (Donny Nadolny via rgs)

Modified:
    zookeeper/branches/branch-3.5/CHANGES.txt
    zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/server/quorum/LearnerSnapshotThrottlerTest.java

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1683603&r1=1683602&r2=1683603&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Thu Jun  4 17:38:40 2015
@@ -114,6 +114,9 @@ BUGFIXES:
   ZOOKEEPER-2194: Let DataNode.getChildren() return an unmodifiable view of its children set
   (Hitoshi Mitake via rgs)
 
+  ZOOKEEPER-2204: LearnerSnapshotThrottlerTest.testHighContentionWithTimeout fails occasionally
+  (Donny Nadolny via rgs)
+
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)
 

Modified: zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/server/quorum/LearnerSnapshotThrottlerTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/server/quorum/LearnerSnapshotThrottlerTest.java?rev=1683603&r1=1683602&r2=1683603&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/server/quorum/LearnerSnapshotThrottlerTest.java (original)
+++ zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/server/quorum/LearnerSnapshotThrottlerTest.java Thu Jun  4 17:38:40 2015
@@ -29,8 +29,13 @@ import java.util.concurrent.Future;
 import org.apache.zookeeper.ZKTestCase;
 import org.junit.Assert;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class LearnerSnapshotThrottlerTest extends ZKTestCase {
+    private static final Logger LOG =
+            LoggerFactory.getLogger(LearnerSnapshotThrottlerTest.class);
+
     @Test(expected = SnapshotThrottleException.class)
     public void testTooManySnapshotsNonessential() throws Exception {
         LearnerSnapshotThrottler throttler = new LearnerSnapshotThrottler(5);
@@ -177,10 +182,9 @@ public class LearnerSnapshotThrottlerTes
     public void testHighContentionWithTimeout() throws Exception {
         int numThreads = 20;
 
-        final LearnerSnapshotThrottler throttler = new LearnerSnapshotThrottler(2, 200);
+        final LearnerSnapshotThrottler throttler = new LearnerSnapshotThrottler(2, 5000);
         ExecutorService threadPool = Executors.newFixedThreadPool(numThreads);
         final CountDownLatch threadStartLatch = new CountDownLatch(numThreads);
-        final CountDownLatch snapshotProgressLatch = new CountDownLatch(numThreads);
 
         List<Future<Boolean>> results = new ArrayList<Future<Boolean>>(numThreads);
         for (int i = 0; i < numThreads; i++) {
@@ -201,6 +205,7 @@ public class LearnerSnapshotThrottlerTes
                         return snapshotNumber <= 2;
                     }
                     catch (Exception e) {
+                        LOG.error("Exception trying to begin snapshot", e);
                         return false;
                     }
                 }