From 4ff2f3e061224339a3818f6725b89c5da96a8406 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Mon, 16 Apr 2018 14:49:54 -0400 Subject: [PATCH] remove setting corresponding to removed tests --- awx/main/models/unified_jobs.py | 4 ---- awx/main/scheduler/task_manager.py | 3 +-- awx/main/tasks.py | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 540d5ee2e7..ab03389535 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -1263,10 +1263,6 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique if not all(opts.values()): return False - # Sanity check: If we are running unit tests, then run synchronously. - if getattr(settings, 'CELERY_UNIT_TEST', False): - return self.start(None, None, **kwargs) - # Save the pending status, and inform the SocketIO listener. self.update_fields(start_args=json.dumps(kwargs), status='pending') self.websocket_emit_status("pending") diff --git a/awx/main/scheduler/task_manager.py b/awx/main/scheduler/task_manager.py index 254b9472d3..f988e76fd3 100644 --- a/awx/main/scheduler/task_manager.py +++ b/awx/main/scheduler/task_manager.py @@ -153,8 +153,7 @@ class TaskManager(): queue_name = queue_name[1 if len(queue_name) > 1 else 0] queues[queue_name] = active_tasks else: - if not hasattr(settings, 'CELERY_UNIT_TEST'): - return (None, None) + return (None, None) return (active_task_queues, queues) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 21f10a16db..4df4ba2524 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1032,7 +1032,7 @@ class BaseTask(Task): except Exception: logger.exception(six.text_type('{} Final run hook errored.').format(instance.log_format)) instance.websocket_emit_status(status) - if status != 'successful' and not hasattr(settings, 'CELERY_UNIT_TEST'): + if status != 'successful': # Raising an exception will mark the job as 'failed' in celery # and will stop a task chain from continuing to execute if status == 'canceled':