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/10/08 02:04:38 UTC

[5/6] git commit: Make timeout for test cases longer to avoid failing too much in Travis when it get scheduled on relatively slow boxes.

Make timeout for test cases longer to avoid failing too much in Travis when it get scheduled on relatively slow boxes.

Project: http://git-wip-us.apache.org/repos/asf/incubator-twill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-twill/commit/7f3d7b8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-twill/tree/7f3d7b8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-twill/diff/7f3d7b8b

Branch: refs/heads/site
Commit: 7f3d7b8b77211819f2f91a561b1a62ce43d510c0
Parents: 7a72ce1
Author: Terence Yim <te...@continuuity.com>
Authored: Tue Sep 23 13:27:10 2014 -0700
Committer: Terence Yim <te...@continuuity.com>
Committed: Tue Sep 23 13:27:10 2014 -0700

----------------------------------------------------------------------
 .../src/test/java/org/apache/twill/yarn/DebugTestRun.java |  8 ++++----
 .../java/org/apache/twill/yarn/ResourceReportTestRun.java | 10 +++++-----
 .../twill/internal/zookeeper/LeaderElectionTest.java      |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/7f3d7b8b/twill-yarn/src/test/java/org/apache/twill/yarn/DebugTestRun.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/test/java/org/apache/twill/yarn/DebugTestRun.java b/twill-yarn/src/test/java/org/apache/twill/yarn/DebugTestRun.java
index 0cb6fc8..e9f00ad 100644
--- a/twill-yarn/src/test/java/org/apache/twill/yarn/DebugTestRun.java
+++ b/twill-yarn/src/test/java/org/apache/twill/yarn/DebugTestRun.java
@@ -118,9 +118,9 @@ public class DebugTestRun extends BaseYarnTest {
       }
     }, Threads.SAME_THREAD_EXECUTOR);
 
-    Assert.assertTrue(running.await(30, TimeUnit.SECONDS));
+    Assert.assertTrue(running.await(120, TimeUnit.SECONDS));
     Assert.assertTrue(waitForDebugPort(controller, "r1", 30));
-    controller.stop().get(30, TimeUnit.SECONDS);
+    controller.stop().get(120, TimeUnit.SECONDS);
     // Sleep a bit before exiting.
     TimeUnit.SECONDS.sleep(2);
   }
@@ -142,10 +142,10 @@ public class DebugTestRun extends BaseYarnTest {
       }
     }, Threads.SAME_THREAD_EXECUTOR);
 
-    Assert.assertTrue(running.await(30, TimeUnit.SECONDS));
+    Assert.assertTrue(running.await(120, TimeUnit.SECONDS));
     Assert.assertTrue(waitForDebugPort(controller, "r1", 30));
     Assert.assertTrue(waitForDebugPort(controller, "r2", 30));
-    controller.stop().get(30, TimeUnit.SECONDS);
+    controller.stop().get(120, TimeUnit.SECONDS);
     // Sleep a bit before exiting.
     TimeUnit.SECONDS.sleep(2);
   }

http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/7f3d7b8b/twill-yarn/src/test/java/org/apache/twill/yarn/ResourceReportTestRun.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/test/java/org/apache/twill/yarn/ResourceReportTestRun.java b/twill-yarn/src/test/java/org/apache/twill/yarn/ResourceReportTestRun.java
index 928a525..3a82272 100644
--- a/twill-yarn/src/test/java/org/apache/twill/yarn/ResourceReportTestRun.java
+++ b/twill-yarn/src/test/java/org/apache/twill/yarn/ResourceReportTestRun.java
@@ -103,10 +103,10 @@ public final class ResourceReportTestRun extends BaseYarnTest {
       }
     }, Threads.SAME_THREAD_EXECUTOR);
 
-    Assert.assertTrue(running.await(30, TimeUnit.SECONDS));
+    Assert.assertTrue(running.await(120, TimeUnit.SECONDS));
 
     Iterable<Discoverable> envEchoServices = controller.discoverService("envecho");
-    Assert.assertTrue(YarnTestUtils.waitForSize(envEchoServices, 1, 30));
+    Assert.assertTrue(YarnTestUtils.waitForSize(envEchoServices, 1, 120));
 
     // TODO: check virtual cores once yarn adds the ability
     Map<String, String> expectedValues = Maps.newHashMap();
@@ -128,7 +128,7 @@ public final class ResourceReportTestRun extends BaseYarnTest {
       }
     }
 
-    controller.stop().get(30, TimeUnit.SECONDS);
+    controller.stop().get(120, TimeUnit.SECONDS);
     // Sleep a bit before exiting.
     TimeUnit.SECONDS.sleep(2);
   }
@@ -215,7 +215,7 @@ public final class ResourceReportTestRun extends BaseYarnTest {
       }
     }, Threads.SAME_THREAD_EXECUTOR);
 
-    Assert.assertTrue(running.await(30, TimeUnit.SECONDS));
+    Assert.assertTrue(running.await(120, TimeUnit.SECONDS));
 
     // wait for 3 echo servers to come up
     Iterable<Discoverable> echoServices = controller.discoverService("echo");
@@ -280,7 +280,7 @@ public final class ResourceReportTestRun extends BaseYarnTest {
       Assert.assertEquals(512, resources.getMemoryMB());
     }
 
-    controller.stop().get(30, TimeUnit.SECONDS);
+    controller.stop().get(120, TimeUnit.SECONDS);
     // Sleep a bit before exiting.
     TimeUnit.SECONDS.sleep(2);
   }

http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/7f3d7b8b/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 d58c11c..847b149 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
@@ -56,7 +56,7 @@ public class LeaderElectionTest {
 
   private static InMemoryZKServer zkServer;
 
-  @Test(timeout = 100000)
+  @Test(timeout = 150000)
   public void testElection() throws ExecutionException, InterruptedException, BrokenBarrierException {
     ExecutorService executor = Executors.newCachedThreadPool();
 
@@ -129,7 +129,7 @@ public class LeaderElectionTest {
     }
   }
 
-  @Test(timeout = 100000)
+  @Test(timeout = 150000)
   public void testCancel() throws InterruptedException, IOException {
     List<LeaderElection> leaderElections = Lists.newArrayList();
     List<ZKClientService> zkClients = Lists.newArrayList();
@@ -213,7 +213,7 @@ public class LeaderElectionTest {
     }
   }
 
-  @Test(timeout = 100000)
+  @Test(timeout = 150000)
   public void testDisconnect() throws IOException, InterruptedException {
     File zkDataDir = tmpFolder.newFolder();
     InMemoryZKServer ownZKServer = InMemoryZKServer.builder().setDataDir(zkDataDir).build();