You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/11/07 19:50:04 UTC

[03/10] git commit: ACCUMULO-1829 Add timeout scaling factor to tests (1.4.x)

ACCUMULO-1829 Add timeout scaling factor to tests (1.4.x)

Slower hardware or VMs may have trouble completing tests within the timeouts
specified. This change adds a -f option to run.py to add a scaling factor
to the maxRuntime for tests, the timeout for Accumulo to shut down, and to
specific timeouts in SimpleBalancerFairness and ZooCacheTest.

Compare to a similar change for ACCUMULO-1789.

Signed-off-by: Eric Newton <er...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/41efe1a7
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/41efe1a7
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/41efe1a7

Branch: refs/heads/master
Commit: 41efe1a7e07d3abae1d82bc6d8340e78210cadc0
Parents: 62c6a22
Author: Bill Havanki <bh...@cloudera.com>
Authored: Wed Oct 30 09:58:33 2013 -0400
Committer: Eric Newton <er...@gmail.com>
Committed: Wed Nov 6 16:07:07 2013 -0500

----------------------------------------------------------------------
 test/system/auto/JavaTest.py              | 1 +
 test/system/auto/TestUtils.py             | 3 ++-
 test/system/auto/run.py                   | 3 +++
 test/system/auto/simple/simpleBalancer.py | 2 +-
 test/system/auto/simple/zooCacheTest.py   | 3 ++-
 5 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/41efe1a7/test/system/auto/JavaTest.py
----------------------------------------------------------------------
diff --git a/test/system/auto/JavaTest.py b/test/system/auto/JavaTest.py
index f80848c..7c22bdb 100755
--- a/test/system/auto/JavaTest.py
+++ b/test/system/auto/JavaTest.py
@@ -41,6 +41,7 @@ class JavaTest(TestUtilsMixin, unittest.TestCase):
         self.settings = TestUtilsMixin.settings.copy()
         self.settings.update(eval(out))
         TestUtilsMixin.setUp(self);
+        self.maxRuntime = self.timeout_factor * self.maxRuntime
 
         handle = self.runJTest(self.masterHost(),'setup')
         out,err = handle.communicate()

http://git-wip-us.apache.org/repos/asf/accumulo/blob/41efe1a7/test/system/auto/TestUtils.py
----------------------------------------------------------------------
diff --git a/test/system/auto/TestUtils.py b/test/system/auto/TestUtils.py
index 4b5efdf..f953bca 100755
--- a/test/system/auto/TestUtils.py
+++ b/test/system/auto/TestUtils.py
@@ -388,7 +388,7 @@ class TestUtilsMixin:
         handle = self.runOn(self.masterHost(),
                  [self.accumulo_sh(), 'admin', '-u', ROOT,
                  '-p', ROOT_PASSWORD, 'stopAll'])
-        self.waitForStop(handle, seconds)
+        self.waitForStop(handle, self.timeout_factor * seconds)
         for host in self.hosts:
             self.stop_logger(host)
         self.stop_monitor(self.masterHost())
@@ -417,6 +417,7 @@ class TestUtilsMixin:
 
     def setUp(self):
         self.hosts = self.options.hosts
+        self.timeout_factor = self.options.timeout_factor
         self.clean_accumulo(self.masterHost())
         self.setup_logging()
         self.start_accumulo()

http://git-wip-us.apache.org/repos/asf/accumulo/blob/41efe1a7/test/system/auto/run.py
----------------------------------------------------------------------
diff --git a/test/system/auto/run.py b/test/system/auto/run.py
index 5a0678b..8e1a9bb 100755
--- a/test/system/auto/run.py
+++ b/test/system/auto/run.py
@@ -243,6 +243,9 @@ def main():
                       help='Start the test list at the given test name')
     parser.add_option('-x', '--xml', dest='xmlreport', default=False, action='store_true',
                       help='Output tests results to xml (jenkins conpatible)')
+    parser.add_option('-f', '--timeout-factor', dest='timeout_factor',
+                      default=1, type=int,
+                      help="Multiplier for some timeouts (use on slower hardware) (%default)")
     
     allTests = getTests()
     options = parseArguments(parser, allTests)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/41efe1a7/test/system/auto/simple/simpleBalancer.py
----------------------------------------------------------------------
diff --git a/test/system/auto/simple/simpleBalancer.py b/test/system/auto/simple/simpleBalancer.py
index f77c9c0..00a2021 100755
--- a/test/system/auto/simple/simpleBalancer.py
+++ b/test/system/auto/simple/simpleBalancer.py
@@ -71,7 +71,7 @@ class SimpleBalancerFairness(SunnyDayTest):
         self.ingester = self.ingest(self.masterHost(),
                                     200000,
                                     size=self.options.size)
-        self.waitForStop(self.ingester, 120)
+        self.waitForStop(self.ingester, self.timeout_factor * 120)
         self.shell(self.masterHost(), 'flush -t test_ingest')
         self.waitForStop(self.verify(self.masterHost(), self.options.rows), 60)
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/41efe1a7/test/system/auto/simple/zooCacheTest.py
----------------------------------------------------------------------
diff --git a/test/system/auto/simple/zooCacheTest.py b/test/system/auto/simple/zooCacheTest.py
index 16b30a6..b9beacb 100755
--- a/test/system/auto/simple/zooCacheTest.py
+++ b/test/system/auto/simple/zooCacheTest.py
@@ -27,6 +27,7 @@ class ZooCacheTest(TestUtilsMixin, unittest.TestCase):
     testClass=""
 
     def setUp(self):
+        self.timeout_factor = self.options.timeout_factor
         self.create_config_file(self.settings.copy())
         
     def runTest(self):
@@ -37,7 +38,7 @@ class ZooCacheTest(TestUtilsMixin, unittest.TestCase):
         handleR2 = self.runClassOn('localhost', 'org.apache.accumulo.server.test.functional.CacheTestReader', ['/zcTest-42','/tmp/zcTest-42', ZOOKEEPERS])
         handleR3 = self.runClassOn('localhost', 'org.apache.accumulo.server.test.functional.CacheTestReader', ['/zcTest-42','/tmp/zcTest-42', ZOOKEEPERS])
         handleW = self.runClassOn('localhost', 'org.apache.accumulo.server.test.functional.CacheTestWriter', ['/zcTest-42','/tmp/zcTest-42','3','500'])
-        self.waitForStop(handleW, 120)
+        self.waitForStop(handleW, 120 * self.timeout_factor)
         self.waitForStop(handleR1, 1)
         self.waitForStop(handleR2, 1)
         self.waitForStop(handleR3, 1)