You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@twill.apache.org by ch...@apache.org on 2014/07/24 01:13:31 UTC
git commit: (TWILL-93) Up the zookeeper timeouts
Repository: incubator-twill
Updated Branches:
refs/heads/master 746d4f6a1 -> e955b9129
(TWILL-93) Up the zookeeper timeouts
Zookeeper runs a tad slow on my Macbook Pro, and tests weren't finishing
within the time limits set in the unit tests. This patch ups those limits
so `mvn test` passes.
Signed-off-by: Terence Yim <te...@continuuity.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-twill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-twill/commit/e955b912
Tree: http://git-wip-us.apache.org/repos/asf/incubator-twill/tree/e955b912
Diff: http://git-wip-us.apache.org/repos/asf/incubator-twill/diff/e955b912
Branch: refs/heads/master
Commit: e955b9129c4c4bb442cd457b18528d10ab4f8df3
Parents: 746d4f6
Author: Erick Tryzelaar <er...@lab41.org>
Authored: Wed Jul 23 11:20:44 2014 -0700
Committer: Terence Yim <te...@continuuity.com>
Committed: Wed Jul 23 15:36:11 2014 -0700
----------------------------------------------------------------------
.../org/apache/twill/discovery/ZKDiscoveryServiceTest.java | 2 +-
.../apache/twill/internal/zookeeper/LeaderElectionTest.java | 8 ++++----
.../test/java/org/apache/twill/zookeeper/ZKClientTest.java | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/e955b912/twill-discovery-core/src/test/java/org/apache/twill/discovery/ZKDiscoveryServiceTest.java
----------------------------------------------------------------------
diff --git a/twill-discovery-core/src/test/java/org/apache/twill/discovery/ZKDiscoveryServiceTest.java b/twill-discovery-core/src/test/java/org/apache/twill/discovery/ZKDiscoveryServiceTest.java
index 0171b74..8d3dec4 100644
--- a/twill-discovery-core/src/test/java/org/apache/twill/discovery/ZKDiscoveryServiceTest.java
+++ b/twill-discovery-core/src/test/java/org/apache/twill/discovery/ZKDiscoveryServiceTest.java
@@ -64,7 +64,7 @@ public class ZKDiscoveryServiceTest extends DiscoveryServiceTestBase {
Futures.getUnchecked(Services.chainStop(zkClient, zkServer));
}
- @Test (timeout = 5000)
+ @Test (timeout = 10000)
public void testDoubleRegister() throws Exception {
Map.Entry<DiscoveryService, DiscoveryServiceClient> entry = create();
DiscoveryService discoveryService = entry.getKey();
http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/e955b912/twill-zookeeper/src/test/java/org/apache/twill/internal/zookeeper/LeaderElectionTest.java
----------------------------------------------------------------------
diff --git a/twill-zookeeper/src/test/java/org/apache/twill/internal/zookeeper/LeaderElectionTest.java b/twill-zookeeper/src/test/java/org/apache/twill/internal/zookeeper/LeaderElectionTest.java
index 468ba59..38c83ca 100644
--- a/twill-zookeeper/src/test/java/org/apache/twill/internal/zookeeper/LeaderElectionTest.java
+++ b/twill-zookeeper/src/test/java/org/apache/twill/internal/zookeeper/LeaderElectionTest.java
@@ -39,7 +39,7 @@ public class LeaderElectionTest {
private static InMemoryZKServer zkServer;
- @Test(timeout = 5000)
+ @Test(timeout = 30000)
public void testElection() throws ExecutionException, InterruptedException, BrokenBarrierException {
ExecutorService executor = Executors.newCachedThreadPool();
@@ -112,7 +112,7 @@ public class LeaderElectionTest {
}
}
- @Test(timeout = 10000)
+ @Test(timeout = 30000)
public void testCancel() throws InterruptedException, IOException {
List<LeaderElection> leaderElections = Lists.newArrayList();
List<ZKClientService> zkClients = Lists.newArrayList();
@@ -156,7 +156,7 @@ public class LeaderElectionTest {
// Kill the follower session
KillZKSession.kill(zkClients.get(follower).getZooKeeperSupplier().get(),
- zkClients.get(follower).getConnectString(), 5000);
+ zkClients.get(follower).getConnectString(), 10000);
// Cancel the leader
leaderElections.get(leader).stopAndWait();
@@ -196,7 +196,7 @@ public class LeaderElectionTest {
}
}
- @Test(timeout = 10000)
+ @Test(timeout = 30000)
public void testDisconnect() throws IOException, InterruptedException {
File zkDataDir = tmpFolder.newFolder();
InMemoryZKServer ownZKServer = InMemoryZKServer.builder().setDataDir(zkDataDir).build();
http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/e955b912/twill-zookeeper/src/test/java/org/apache/twill/zookeeper/ZKClientTest.java
----------------------------------------------------------------------
diff --git a/twill-zookeeper/src/test/java/org/apache/twill/zookeeper/ZKClientTest.java b/twill-zookeeper/src/test/java/org/apache/twill/zookeeper/ZKClientTest.java
index 40b0a39..2f45367 100644
--- a/twill-zookeeper/src/test/java/org/apache/twill/zookeeper/ZKClientTest.java
+++ b/twill-zookeeper/src/test/java/org/apache/twill/zookeeper/ZKClientTest.java
@@ -195,9 +195,9 @@ public class ZKClientTest {
client.create("/expireRewatch", null, CreateMode.PERSISTENT);
Assert.assertEquals(Watcher.Event.EventType.NodeCreated, events.poll(2, TimeUnit.SECONDS));
- KillZKSession.kill(client.getZooKeeperSupplier().get(), zkServer.getConnectionStr(), 1000);
+ KillZKSession.kill(client.getZooKeeperSupplier().get(), zkServer.getConnectionStr(), 10000);
- Assert.assertTrue(expireReconnectLatch.await(5, TimeUnit.SECONDS));
+ Assert.assertTrue(expireReconnectLatch.await(10, TimeUnit.SECONDS));
client.delete("/expireRewatch");
Assert.assertEquals(Watcher.Event.EventType.NodeDeleted, events.poll(4, TimeUnit.SECONDS));
@@ -255,7 +255,7 @@ public class ZKClientTest {
zkServer.startAndWait();
try {
- Assert.assertTrue(createLatch.await(5, TimeUnit.SECONDS));
+ Assert.assertTrue(createLatch.await(10, TimeUnit.SECONDS));
} finally {
zkServer.stopAndWait();
}