From: Nathan Cutler Date: Thu, 27 Sep 2018 08:57:23 +0000 (+0200) Subject: Revert "suite: Implement --sleep-before-teardown option" X-Git-Tag: 1.1.0~305^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1215%2Fhead;p=teuthology.git Revert "suite: Implement --sleep-before-teardown option" This reverts commit c81ee9618faa6aeb56a4cc741e9f937b287b065e, which broke the sequential and parallel tasks. Fixes: https://tracker.ceph.com/issues/36230 Signed-off-by: Nathan Cutler --- diff --git a/scripts/openstack.py b/scripts/openstack.py index ce9f05ee9..b467de4f5 100644 --- a/scripts/openstack.py +++ b/scripts/openstack.py @@ -191,10 +191,5 @@ and analyze results. '--ceph-qa-suite-git-url', help=("git clone url for ceph-qa-suite"), ) - parser.add_argument( - '--sleep-before-teardown', - help='Number of seconds to sleep before tearing down the target VMs', - default=0 - ) return parser.parse_args(argv) diff --git a/scripts/suite.py b/scripts/suite.py index 2de6ee12f..44b4fac74 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -71,11 +71,6 @@ Standard arguments: to be ignored for scheduling purposes, but it will still be used for test running. - --sleep-before-teardown - Number of seconds to sleep before tearing down - the test cluster(s). Use with care, as this - applies to all jobs in the run. - [default: 0] Scheduler arguments: --owner Job owner diff --git a/teuthology/config.py b/teuthology/config.py index 965dc6f5f..16b698746 100644 --- a/teuthology/config.py +++ b/teuthology/config.py @@ -177,7 +177,6 @@ class TeuthologyConfig(YamlConfig): 'size': 1, }, }, - 'sleep_before_teardown': 0, } def __init__(self, yaml_path=None): diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index 3b4e4798d..6dba83300 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -59,25 +59,14 @@ def _import(from_package, module_name, task_name): return module -def run_one_task(taskname, stack, timer, **kwargs): - if 'log_message' in kwargs: - log.info(kwargs['log_message']) - del(kwargs['log_message']) - else: - log.info("Running task {}...".format(taskname)) - timer.mark('%s enter' % taskname) +def run_one_task(taskname, **kwargs): taskname = taskname.replace('-', '_') task = get_task(taskname) - manager = task(**kwargs) - if hasattr(manager, '__enter__'): - stack.append((taskname, manager)) - manager.__enter__() + return task(**kwargs) def run_tasks(tasks, ctx): archive_path = ctx.config.get('archive_path') - sleep_before_teardown = ctx.config.get('sleep_before_teardown') - sleep_task = { "sleep": { "duration": sleep_before_teardown } } if archive_path: timer = Timer( path=os.path.join(archive_path, 'timing.yaml'), @@ -92,11 +81,12 @@ def run_tasks(tasks, ctx): ((taskname, config),) = taskdict.iteritems() except (ValueError, AttributeError): raise RuntimeError('Invalid task definition: %s' % taskdict) - run_one_task(taskname, stack, timer, ctx=ctx, config=config) - if sleep_before_teardown: - ((taskname, config),) = sleep_task.iteritems() - run_one_task(taskname, stack, timer, ctx=ctx, config=config, - log_message='Running sleep task because --sleep-before-teardown was given...') + log.info('Running task %s...', taskname) + timer.mark('%s enter' % taskname) + manager = run_one_task(taskname, ctx=ctx, config=config) + if hasattr(manager, '__enter__'): + stack.append((taskname, manager)) + manager.__enter__() except BaseException as e: if isinstance(e, ConnectionLostError): # Prevent connection issues being flagged as failures @@ -149,10 +139,6 @@ def run_tasks(tasks, ctx): from .task import interactive log.warning('Saw failure during task execution, going into interactive mode...') interactive.task(ctx=ctx, config=None) - if sleep_before_teardown: - ((taskname, config),) = sleep_task.iteritems() - run_one_task(taskname, stack, timer, ctx=ctx, config=config, - log_message='Running sleep task because --sleep-before-teardown was given...') # Throughout teuthology, (x,) = y has been used to assign values # from yaml files where only one entry of type y is correct. This # causes failures with 'too many values to unpack.' We want to diff --git a/teuthology/suite/placeholder.py b/teuthology/suite/placeholder.py index f029405e1..9af2ffb78 100644 --- a/teuthology/suite/placeholder.py +++ b/teuthology/suite/placeholder.py @@ -95,7 +95,6 @@ dict_templ = { } }, 'repo': Placeholder('ceph_repo'), - 'sleep_before_teardown': 0, 'suite': Placeholder('suite'), 'suite_repo': Placeholder('suite_repo'), 'suite_relpath': Placeholder('suite_relpath'), diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 64d20b46e..5c01e39ce 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -273,8 +273,6 @@ class Run(object): job_config.email = self.args.email if self.args.owner: job_config.owner = self.args.owner - if self.args.sleep_before_teardown: - job_config.sleep_before_teardown = int(self.args.sleep_before_teardown) return job_config def build_base_args(self):