summaryrefslogtreecommitdiff
path: root/buildbot
diff options
context:
space:
mode:
authorChris Sosa <sosa@chromium.org>2014-05-16 10:07:26 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-21 04:13:07 +0000
commit4480fbfbaa07b3dfa8b418adfa3439175a0a3535 (patch)
tree49740066408e5fa164af10ee22836f02eb8354c8 /buildbot
parentfbf50480edf5bf87b4e61502361d253edc70c78d (diff)
downloadchromite-4480fbfbaa07b3dfa8b418adfa3439175a0a3535.tar.gz
Modify non-ToT builders to have hwtests run with longer timeouts and lower priority.
BUG=chromium:373512 TEST=Unittests Change-Id: I95d06ce8651acff15fe322ed31731f5569d0bb19 Reviewed-on: https://chromium-review.googlesource.com/200243 Reviewed-by: Chris Sosa <sosa@chromium.org> Commit-Queue: Chris Sosa <sosa@chromium.org> Tested-by: Chris Sosa <sosa@chromium.org>
Diffstat (limited to 'buildbot')
-rwxr-xr-xbuildbot/cbuildbot_config.py11
-rw-r--r--buildbot/cbuildbot_run.py4
-rw-r--r--buildbot/constants.py10
-rw-r--r--buildbot/stages/test_stages.py5
-rwxr-xr-xbuildbot/stages/test_stages_unittest.py11
5 files changed, 40 insertions, 1 deletions
diff --git a/buildbot/cbuildbot_config.py b/buildbot/cbuildbot_config.py
index 70168db11..957f92f99 100755
--- a/buildbot/cbuildbot_config.py
+++ b/buildbot/cbuildbot_config.py
@@ -647,6 +647,7 @@ class HWTestConfig(object):
# This timeout is larger than it needs to be because of autotest overhead.
# TODO(davidjames): Reduce this timeout once http://crbug.com/366141 is fixed.
DEFAULT_HW_TEST_TIMEOUT = 60 * 220
+ BRANCHED_HW_TEST_TIMEOUT = 10 * 60 * 60
# Number of tests running in parallel in the AU suite.
AU_TESTS_NUM = 2
# Number of tests running in parallel in the QAV suite
@@ -727,6 +728,16 @@ class HWTestConfig(object):
self.file_bugs = file_bugs
self.priority = priority
+ def SetBranchedValues(self):
+ """Changes the HW Test timeout/priority values to branched values."""
+ self.timeout = max(HWTestConfig.BRANCHED_HW_TEST_TIMEOUT, self.timeout)
+
+ # Only reduce priority if it's lower.
+ new_priority = constants.HWTEST_DEFAULT_PRIORITY
+ if (constants.HWTEST_PRIORITIES_MAP[self.priority] >
+ constants.HWTEST_PRIORITIES_MAP[new_priority]):
+ self.priority = new_priority
+
@property
def timeout_mins(self):
return int(self.timeout / 60)
diff --git a/buildbot/cbuildbot_run.py b/buildbot/cbuildbot_run.py
index 59940fddc..8484632a8 100644
--- a/buildbot/cbuildbot_run.py
+++ b/buildbot/cbuildbot_run.py
@@ -613,6 +613,10 @@ class _BuilderRunBase(object):
"""Look up the RunAttributes object for this BuilderRun object."""
return self._ATTRS[self._attrs_id]
+ def IsToTBuild(self):
+ """Returns True if Builder is running on ToT."""
+ return self.manifest_branch == 'master'
+
def GetArchive(self):
"""Create an Archive object for this BuilderRun object."""
# The Archive class is very lightweight, and is read-only, so it
diff --git a/buildbot/constants.py b/buildbot/constants.py
index 27f1e8a74..f8964f49a 100644
--- a/buildbot/constants.py
+++ b/buildbot/constants.py
@@ -276,11 +276,17 @@ HWTEST_TRYBOT_POOL = 'try-bot'
HWTEST_AU_SUITE = 'au'
HWTEST_QAV_SUITE = 'qav'
+# Additional timeout to wait for autotest to abort a suite if the test takes
+# too long to run. This is meant to be overly conservative as a timeout may
+# indicate that autotest is at capacity.
HWTEST_TIMEOUT_EXTENSION = 10 * 60
+
HWTEST_DEFAULT_PRIORITY = 'DEFAULT'
HWTEST_CQ_PRIORITY = 'CQ'
HWTEST_BUILD_PRIORITY = 'Build'
HWTEST_PFQ_PRIORITY = 'PFQ'
+
+# Ordered by priority (first item being lowest).
HWTEST_VALID_PRIORITIES = ['Weekly',
'Daily',
'PostBuild',
@@ -289,6 +295,10 @@ HWTEST_VALID_PRIORITIES = ['Weekly',
HWTEST_PFQ_PRIORITY,
HWTEST_CQ_PRIORITY]
+# Creates a mapping of priorities to make easy comparsions.
+HWTEST_PRIORITIES_MAP = dict(zip(HWTEST_VALID_PRIORITIES,
+ range(len(HWTEST_VALID_PRIORITIES))))
+
# Defines VM Test types.
FULL_AU_TEST_TYPE = 'full_suite'
SIMPLE_AU_TEST_TYPE = 'pfq_suite'
diff --git a/buildbot/stages/test_stages.py b/buildbot/stages/test_stages.py
index 5ac34b404..beb7866d0 100644
--- a/buildbot/stages/test_stages.py
+++ b/buildbot/stages/test_stages.py
@@ -199,6 +199,9 @@ class HWTestStage(generic_stages.BoardSpecificBuilderStage,
super(HWTestStage, self).__init__(builder_run, board,
suffix=' [%s]' % suite_config.suite,
**kwargs)
+ if not self._run.IsToTBuild():
+ suite_config.SetBranchedValues()
+
self.suite_config = suite_config
self.wait_for_results = True
@@ -271,7 +274,7 @@ class HWTestStage(generic_stages.BoardSpecificBuilderStage,
lab_status.CheckLabStatus(self._current_board)
with timeout_util.Timeout(
- self.suite_config.timeout + constants.HWTEST_TIMEOUT_EXTENSION):
+ self.suite_config.timeout + constants.HWTEST_TIMEOUT_EXTENSION):
commands.RunHWTestSuite(build,
self.suite_config.suite,
self._current_board,
diff --git a/buildbot/stages/test_stages_unittest.py b/buildbot/stages/test_stages_unittest.py
index 447c11a13..c14f6646d 100755
--- a/buildbot/stages/test_stages_unittest.py
+++ b/buildbot/stages/test_stages_unittest.py
@@ -279,6 +279,17 @@ class HWTestStageTest(generic_stages_unittest.AbstractStageTest):
self.RunStage()
self.mox.VerifyAll()
+ def testBranchedBuildExtendsTimeouts(self):
+ """Tests that we run with an extended timeout on a branched build."""
+ cmd_args = ['--branch', 'notTot', '-r', self.build_root,
+ '--remote-trybot', '--hwtest']
+ self._Prepare('x86-alex-release', cmd_args=cmd_args)
+ self._RunHWTestSuite()
+ self.assertEqual(self.suite_config.timeout,
+ config.HWTestConfig.BRANCHED_HW_TEST_TIMEOUT)
+ self.assertEqual(self.suite_config.priority,
+ constants.HWTEST_DEFAULT_PRIORITY)
+
class AUTestStageTest(generic_stages_unittest.AbstractStageTest,
cros_build_lib_unittest.RunCommandTestCase):