commit/galaxy-central: Dave Bouvier: Use walltime configured in job_conf.xml instead of maxseconds for determining whether a test tool run is stuck.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bba295ef97e4/ Changeset: bba295ef97e4 User: Dave Bouvier Date: 2013-12-05 19:52:22 Summary: Use walltime configured in job_conf.xml instead of maxseconds for determining whether a test tool run is stuck. Affected #: 3 files diff -r 66e0f985ad0b9b33e5429979651e363a656ac686 -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 scripts/functional_tests.py --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -72,6 +72,24 @@ # 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 = '''<?xml version="1.0"?> +<!-- A test job config that explicitly configures job running the way it is configured by default (if there is no explicit config). --> +<job_conf> + <plugins> + <plugin id="local" type="runner" load="galaxy.jobs.runners.local:LocalJobRunner" workers="4"/> + </plugins> + <handlers> + <handler id="main"/> + </handlers> + <destinations> + <destination id="local" runner="local"/> + </destinations> + <limits> + <limit type="walltime">00:10:00</limit> + </limits> +</job_conf> +''' def get_static_settings(): """Returns dictionary of the settings necessary for a galaxy App @@ -231,6 +249,11 @@ 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 -r 66e0f985ad0b9b33e5429979651e363a656ac686 -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 test/base/twilltestcase.py --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1424,20 +1424,21 @@ """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 -r 66e0f985ad0b9b33e5429979651e363a656ac686 -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 test/install_and_test_tool_shed_repositories/functional_tests.py --- 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 @@ # 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 = '''<?xml version="1.0"?><!-- A test job config that explicitly configures job running the way it is configured by default (if there is no explicit config). --><job_conf> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org