You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@omid.apache.org by fp...@apache.org on 2016/06/03 21:27:30 UTC

[03/23] incubator-omid git commit: [OMID-27] Increase test timeouts in Tests

[OMID-27] Increase test timeouts in Tests

In some environments (e.g. slow machines) PersistenceProcessor or
LeaseManager tests fail because either the specified default timeout
or the lease period are not sufficiently high.
Default timeouts for tests have been increased to at least 30 seconds
and the default lease period in test to 5 seconds.

Change-Id: I4b4aef7570ee05fa6c3f67a2f10c9c1da4d37c28


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

Branch: refs/heads/master
Commit: a4e7f56fe442bcb93a8c8604f35be9109f99a255
Parents: 5eb385b
Author: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Authored: Wed May 18 12:55:40 2016 -0700
Committer: Francisco Perez-Sorrosal <fp...@yahoo-inc.com>
Committed: Wed May 18 14:40:47 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/omid/tso/TestLeaseManager.java  | 12 ++++++------
 .../apache/omid/tso/TestPersistenceProcessor.java   | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a4e7f56f/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
index 1fc93a3..baef807 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestLeaseManager.java
@@ -63,7 +63,7 @@ public class TestLeaseManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestLeaseManager.class);
 
-    private static final long TEST_LEASE_PERIOD_IN_MS = 1000; // 1 second
+    private static final long TEST_LEASE_PERIOD_IN_MS = 5000; // 5 seconds
 
     private CuratorFramework zkClient;
     private TestingServer zkServer;
@@ -96,7 +96,7 @@ public class TestLeaseManager {
 
     }
 
-    @Test(timeOut = 30_000)
+    @Test(timeOut = 80_000)
     public void testErrorInitializingTSOStateExitsTheTSO() throws Exception {
 
         final String TEST_TSO_LEASE_PATH = "/test0_tsolease";
@@ -126,7 +126,7 @@ public class TestLeaseManager {
 
     }
 
-    @Test(timeOut = 60_000)
+    @Test(timeOut = 80_000)
     public void testLeaseHolderDoesNotChangeWhenPausedForALongTimeAndTheresNoOtherInstance() throws Exception {
 
         final String TEST_TSO_LEASE_PATH = "/test1_tsolease";
@@ -177,7 +177,7 @@ public class TestLeaseManager {
 
     }
 
-    @Test(timeOut = 60_000)
+    @Test(timeOut = 80_000)
     public void testLeaseHolderDoesNotChangeWhenANewLeaseManagerIsUp() throws Exception {
 
         final String TEST_TSO_LEASE_PATH = "/test2_tsolease";
@@ -230,7 +230,7 @@ public class TestLeaseManager {
         assertFalse(leaseManager2.stillInLeasePeriod());
     }
 
-    @Test(timeOut = 60_000)
+    @Test(timeOut = 80_000)
     public void testLeaseHolderChangesWhenActiveLeaseManagerIsPaused() throws Exception {
 
         final String TEST_TSO_LEASE_PATH = "/test3_tsolease";
@@ -324,7 +324,7 @@ public class TestLeaseManager {
     }
 
 
-    @Test(timeOut = 40_000)
+    @Test(timeOut = 80_000)
     public void testLeaseManagerPanicsWhenUnexpectedInfoIsFoundInCurrentTSOZnode() throws Exception {
 
         final String TEST_TSO_LEASE_PATH = "/test_wronginfo_tsolease";

http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/a4e7f56f/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
----------------------------------------------------------------------
diff --git a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
index 2bf7cf6..66381ba 100644
--- a/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
+++ b/tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessor.java
@@ -95,7 +95,7 @@ public class TestPersistenceProcessor {
         Mockito.reset(mockWriter);
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testLowWatermarkIsPersisted() throws Exception {
 
         TSOServerConfig tsoConfig = new TSOServerConfig();
@@ -129,7 +129,7 @@ public class TestPersistenceProcessor {
 
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testCommitPersistenceWithSingleCommitTableWriter() throws Exception {
 
         final int NUM_CT_WRITERS = 1;
@@ -172,7 +172,7 @@ public class TestPersistenceProcessor {
 
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testCommitPersistenceWithMultipleCommitTableWriters() throws Exception {
 
         final int NUM_CT_WRITERS = 2;
@@ -242,7 +242,7 @@ public class TestPersistenceProcessor {
 
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testCommitPersistenceWithNonHALeaseManager() throws Exception {
 
         final int NUM_CT_WRITERS = 1;
@@ -285,7 +285,7 @@ public class TestPersistenceProcessor {
 
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testCommitPersistenceWithHALeaseManagerAndMinimumCommitTableWriters() throws Exception {
 
         final int NUM_PERSIST_HANDLERS = 2; // Minimum commit table writers is 2
@@ -300,7 +300,7 @@ public class TestPersistenceProcessor {
 
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testCommitPersistenceWithHALeaseManagerAndMultipleCommitTableWriters() throws Exception {
 
         final int NUM_CT_WRITERS = 4;
@@ -423,7 +423,7 @@ public class TestPersistenceProcessor {
         return handlers;
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testCommitTableExceptionOnCommitPersistenceTakesDownDaemon() throws Exception {
 
         // Init lease management (doesn't matter if HA or not)
@@ -464,7 +464,7 @@ public class TestPersistenceProcessor {
 
     }
 
-    @Test(timeOut = 10_000)
+    @Test(timeOut = 30_000)
     public void testRuntimeExceptionOnCommitPersistenceTakesDownDaemon() throws Exception {
 
         TSOServerConfig config = new TSOServerConfig();