Fix all but one unit test.

This commit is contained in:
Luke Sneeringer 2014-11-07 14:26:31 -06:00
parent ec55603e3f
commit ed34d5f469
8 changed files with 9 additions and 13 deletions

View File

@ -68,7 +68,7 @@ class CallbackReceiver(object):
main_process = Process(
target=self.callback_handler,
args=(use_workers, worker_queues,),
args=(use_workers, worker_queues,)
)
main_process.daemon = True
main_process.start()
@ -146,7 +146,6 @@ class CallbackReceiver(object):
# queue_actual_worker[2] = w
last_parent_events[message['job_id']] = job_parent_events
self.consumer_subscriber.send("1")
def process_job_event(self, data):
# Sanity check: Do we need to do anything at all?

View File

@ -191,7 +191,7 @@ class BaseTask(Task):
# Log out the error to the debug logger.
logger.debug('Database error updating %s, retrying in 5 '
'seconds (retry #%d): %s',
self.model._meta.object_name, retry_count + 1, e)
self.model._meta.object_name, _attempt + 1, e)
# Attempt to retry the update, assuming we haven't already
# tried too many times.

View File

@ -452,10 +452,10 @@ class BaseTestMixin(object):
if hasattr(self, 'taskmanager_process'):
self.taskmanager_process.terminate()
def start_queue(self, consumer_port, queue_port):
def start_queue(self):
receiver = CallbackReceiver()
self.queue_process = Process(target=receiver.run_subscriber,
args=(consumer_port, queue_port, False,))
args=(False,))
self.queue_process.start()
def terminate_queue(self):

View File

@ -304,8 +304,7 @@ class CleanupJobsTest(BaseCommandMixin, BaseLiveServerTest):
self.project = None
self.credential = None
settings.INTERNAL_API_URL = self.live_server_url
if settings.CALLBACK_CONSUMER_PORT:
self.start_queue(settings.CALLBACK_CONSUMER_PORT, settings.CALLBACK_QUEUE_PORT)
self.start_queue()
def tearDown(self):
super(CleanupJobsTest, self).tearDown()

View File

@ -1087,7 +1087,7 @@ class InventoryUpdatesTest(BaseTransactionTest):
self.group = self.inventory.groups.create(name='Cloud Group')
self.inventory2 = self.organization.inventories.create(name='Cloud Inventory 2')
self.group2 = self.inventory2.groups.create(name='Cloud Group 2')
self.start_queue(settings.CALLBACK_CONSUMER_PORT, settings.CALLBACK_QUEUE_PORT)
self.start_queue()
def tearDown(self):
super(InventoryUpdatesTest, self).tearDown()

View File

@ -680,8 +680,7 @@ class BaseJobTestMixin(BaseTestMixin):
def setUp(self):
super(BaseJobTestMixin, self).setUp()
self.populate()
if settings.CALLBACK_CONSUMER_PORT:
self.start_queue(settings.CALLBACK_CONSUMER_PORT, settings.CALLBACK_QUEUE_PORT)
self.start_queue()
def tearDown(self):
super(BaseJobTestMixin, self).tearDown()

View File

@ -734,7 +734,7 @@ class ProjectUpdatesTest(BaseTransactionTest):
def setUp(self):
super(ProjectUpdatesTest, self).setUp()
self.start_queue(settings.CALLBACK_CONSUMER_PORT, settings.CALLBACK_QUEUE_PORT)
self.start_queue()
self.setup_users()
def tearDown(self):

View File

@ -360,8 +360,7 @@ class RunJobTest(BaseCeleryTest):
self.credential = None
self.cloud_credential = None
settings.INTERNAL_API_URL = self.live_server_url
if settings.CALLBACK_CONSUMER_PORT:
self.start_queue(settings.CALLBACK_CONSUMER_PORT, settings.CALLBACK_QUEUE_PORT)
self.start_queue()
def tearDown(self):
super(RunJobTest, self).tearDown()