zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject zookeeper git commit: ZOOKEEPER-3046: added junit timeout to precede 'ant' timeout
Date Mon, 21 May 2018 18:12:32 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.5 b4be5d593 -> 831bfebae


ZOOKEEPER-3046: added junit timeout to precede 'ant' timeout

When 'ant' timeout triggers, output of the test isn't captured.
Related issue ZOOKEEPER-2916

Author: Bogdan Kanivets <bkanivets@gmail.com>

Reviewers: phunt@apache.org

Closes #523 from lavacat/test-timeouts

Change-Id: I4941451395bd4f35342582e9f4852d73104da138


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

Branch: refs/heads/branch-3.5
Commit: 831bfebaec2500c5672fd665020b517282d9a8a9
Parents: b4be5d5
Author: Bogdan Kanivets <bkanivets@gmail.com>
Authored: Mon May 21 11:11:40 2018 -0700
Committer: Patrick Hunt <phunt@apache.org>
Committed: Mon May 21 11:11:40 2018 -0700

----------------------------------------------------------------------
 .../apache/zookeeper/server/quorum/StandaloneDisabledTest.java | 6 +++++-
 .../org/apache/zookeeper/test/DisconnectedWatcherTest.java     | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/831bfeba/src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
b/src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
index a50e98a..b08bd23 100644
--- a/src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
+++ b/src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java
@@ -28,6 +28,7 @@ import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.PortAssignment;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.admin.ZooKeeperAdmin;
+import org.apache.zookeeper.client.FourLetterWordMain;
 import org.apache.zookeeper.test.ClientBase;
 import org.apache.zookeeper.test.ReconfigTest;
 import org.junit.Assert;
@@ -52,7 +53,7 @@ public class StandaloneDisabledTest extends QuorumPeerTestBase {
      * Test normal quorum operations work cleanly
      * with just a single server.
      */
-    @Test
+    @Test(timeout = 600000)
     public void startSingleServerTest() throws Exception {
         setUpData();
 
@@ -179,6 +180,9 @@ public class StandaloneDisabledTest extends QuorumPeerTestBase {
         zkHandles[id] = ClientBase.createZKClient("127.0.0.1:" + clientPorts[id]);
         zkAdminHandles[id] = new ZooKeeperAdmin("127.0.0.1:" + clientPorts[id], CONNECTION_TIMEOUT,
this);
         zkAdminHandles[id].addAuthInfo("digest", "super:test".getBytes());
+        String statCommandOut = FourLetterWordMain.send4LetterWord("127.0.0.1", clientPorts[id],
"stat");
+        LOG.info(String.format("Started server id %d with config:\n%s\nStat output:\n%s",
+                id, config, statCommandOut));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/831bfeba/src/java/test/org/apache/zookeeper/test/DisconnectedWatcherTest.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/test/DisconnectedWatcherTest.java b/src/java/test/org/apache/zookeeper/test/DisconnectedWatcherTest.java
index cad38f0..017618e 100644
--- a/src/java/test/org/apache/zookeeper/test/DisconnectedWatcherTest.java
+++ b/src/java/test/org/apache/zookeeper/test/DisconnectedWatcherTest.java
@@ -178,7 +178,7 @@ public class DisconnectedWatcherTest extends ClientBase {
 
     // @see jira issue ZOOKEEPER-706. Test auto reset of a large number of
     // watches which require multiple SetWatches calls.
-    @Test
+    @Test(timeout = 600000)
     public void testManyChildWatchersAutoReset() throws Exception {
         ZooKeeper zk1 = createClient();
 
@@ -199,6 +199,7 @@ public class DisconnectedWatcherTest extends ClientBase {
                                      CreateMode.PERSISTENT_SEQUENTIAL);
             paths.add(path);
         }
+        LOG.info("Created 10,000 nodes.");
 
         MyWatcher childWatcher = new MyWatcher();
 


Mime
View raw message