summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcbuildbot/cbuildbot_config.py2
-rwxr-xr-xcbuildbot/cbuildbot_config_unittest.py13
-rw-r--r--lib/parallel.py8
-rwxr-xr-xlib/parallel_unittest.py14
4 files changed, 19 insertions, 18 deletions
diff --git a/cbuildbot/cbuildbot_config.py b/cbuildbot/cbuildbot_config.py
index dbb89a4b4..71253a84e 100755
--- a/cbuildbot/cbuildbot_config.py
+++ b/cbuildbot/cbuildbot_config.py
@@ -628,8 +628,6 @@ class HWTestConfig(object):
Members:
timeout: Number of seconds to wait before timing out waiting for results.
- Defaults to 2 hours and ten minutes. This must be less than
- lib.parallel._BackgroundTask.MINIMUM_SILENT_TIMEOUT.
pool: Pool to use for hw testing.
async: Fire-and-forget suite.
warn_only: Failure on HW tests warns only (does not generate error). If set,
diff --git a/cbuildbot/cbuildbot_config_unittest.py b/cbuildbot/cbuildbot_config_unittest.py
index 2a46d1a88..b75024950 100755
--- a/cbuildbot/cbuildbot_config_unittest.py
+++ b/cbuildbot/cbuildbot_config_unittest.py
@@ -18,7 +18,6 @@ from chromite.lib import cros_build_lib
from chromite.lib import cros_test_lib
from chromite.lib import git
from chromite.lib import osutils
-from chromite.lib import parallel
CHROMIUM_WATCHING_URL = ('http://src.chromium.org/chrome/trunk/tools/build/'
'masters/master.chromium.chromiumos/master_chromiumos_cros_cfg.py')
@@ -224,18 +223,6 @@ class CBuildBotTest(cros_test_lib.MoxTestCase):
"%s is trying to run hw tests without uploading payloads." %
build_name)
- def testHWTestTimeout(self):
- """Verify that hw test timeout is in a reasonable range."""
- # The parallel library will kill the process if it's silent for longer
- # than the silent timeout.
- # pylint: disable=W0212
- max_timeout = parallel._BackgroundTask.SILENT_TIMEOUT
- for build_name, config in cbuildbot_config.config.iteritems():
- for test_config in config['hw_tests']:
- self.assertTrue(test_config.timeout < max_timeout,
- '%s has a hw_tests_timeout of %s that is too large. Expected %s' %
- (build_name, test_config.timeout, max_timeout))
-
def testValidUnifiedMasterConfig(self):
"""Make sure any unified master configurations are valid."""
for build_name, config in cbuildbot_config.config.iteritems():
diff --git a/lib/parallel.py b/lib/parallel.py
index f337e8c7f..028b1c28a 100644
--- a/lib/parallel.py
+++ b/lib/parallel.py
@@ -117,9 +117,11 @@ class _BackgroundTask(multiprocessing.Process):
STARTUP_TIMEOUT = 60 * 5
EXIT_TIMEOUT = 60 * 10
- # TODO: crbug.com/360063
- # The time we allow processes to be silent.
- SILENT_TIMEOUT = 60 * 230
+ # The time we allow processes to be silent. This is in place so that we
+ # eventually catch hanging processes, and print the remainder of our output.
+ # Do not increase this. Instead, adjust your program to print regular progress
+ # updates, so that cbuildbot (and buildbot) can know that it has not hung.
+ SILENT_TIMEOUT = 60 * 145
# The amount by which we reduce the SILENT_TIMEOUT every time we launch
# a subprocess. This helps ensure that children get a chance to enforce the
diff --git a/lib/parallel_unittest.py b/lib/parallel_unittest.py
index ef1cb2117..2c4c02628 100755
--- a/lib/parallel_unittest.py
+++ b/lib/parallel_unittest.py
@@ -440,6 +440,20 @@ class TestHalting(cros_test_lib.MockOutputTestCase, TestBackgroundWrapper):
self.assertTrue(ex_str)
+class TestConstants(cros_test_lib.TestCase):
+ """Test values of constants."""
+
+ def testSilentTimeout(self):
+ """Verify the silent timeout is small enough."""
+ # Enforce that the default timeout is less than 9000, the default timeout
+ # set in build/scripts/master/factory/chromeos_factory.py:ChromiteFactory
+ # in the Chrome buildbot source code.
+ self.assertLess(parallel._BackgroundTask.SILENT_TIMEOUT, 9000,
+ 'Do not increase this timeout. Instead, print regular progress '
+ 'updates, so that buildbot (and cbuildbot) will will know that your '
+ 'program has not hung.')
+
+
if __name__ == '__main__':
# Run the tests.
cros_test_lib.main(level=logging.INFO)