diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py index 049674067e3..b5823dbe796 100644 --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -72,6 +72,24 @@ installed_tool_panel_configs = [ 'shed_tool_conf.xml' ] # should this serve static resources (scripts, images, styles, etc.) STATIC_ENABLED = True +# Set up a job_conf.xml that explicitly limits jobs to 10 minutes. +job_conf_xml = ''' + + + + + + + + + + + + + 00:10:00 + + +''' def get_static_settings(): """Returns dictionary of the settings necessary for a galaxy App @@ -231,6 +249,11 @@ def main(): if galaxy_test_tmp_dir is None: galaxy_test_tmp_dir = tempfile.mkdtemp() + galaxy_job_conf_file = os.environ.get( 'GALAXY_TEST_JOB_CONF', + os.path.join( galaxy_test_tmp_dir, 'test_job_conf.xml' ) ) + # Generate the job_conf.xml file. + file( galaxy_job_conf_file, 'w' ).write( job_conf_xml ) + database_auto_migrate = False galaxy_test_proxy_port = None diff --git a/test/base/twilltestcase.py b/test/base/twilltestcase.py index f95592c0d9a..f75ba9f2515 100644 --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1424,20 +1424,21 @@ class TwillTestCase( unittest.TestCase ): """Waits for the tools to finish""" return self.wait_for(lambda: self.get_running_datasets(), **kwds) - def wait_for(self, func, maxseconds=120): + def wait_for( self, func, **kwd ): sleep_amount = 0.1 slept = 0 - while slept <= maxseconds: + walltime_exceeded = 86400 + while slept <= walltime_exceeded: result = func() if result: time.sleep( sleep_amount ) slept += sleep_amount sleep_amount *= 2 - if slept + sleep_amount > maxseconds: - sleep_amount = maxseconds - slept # don't overshoot maxseconds + if slept + sleep_amount > walltime_exceeded: + sleep_amount = walltime_exceeded - slept # don't overshoot maxseconds else: break - assert slept < maxseconds + assert slept < walltime_exceeded, 'Tool run exceeded reasonable walltime of 24 hours, terminating.' # Dataset Security stuff # Tests associated with users diff --git a/test/install_and_test_tool_shed_repositories/functional_tests.py b/test/install_and_test_tool_shed_repositories/functional_tests.py index 669b1b95038..149b56eb6b0 100644 --- a/test/install_and_test_tool_shed_repositories/functional_tests.py +++ b/test/install_and_test_tool_shed_repositories/functional_tests.py @@ -91,6 +91,7 @@ else: # Should this serve static resources (scripts, images, styles, etc.)? STATIC_ENABLED = True +# Set up a job_conf.xml that explicitly limits jobs to 10 minutes. job_conf_xml = '''