kopia lustrzana https://github.com/OpenDroneMap/WebODM
More unit test fixes
rodzic
8306fd7539
commit
b8665ad181
|
@ -301,7 +301,6 @@ class Task(models.Model):
|
||||||
self.processing_node.save()
|
self.processing_node.save()
|
||||||
|
|
||||||
logger.info("Automatically assigned processing node {} to {}".format(self.processing_node, self))
|
logger.info("Automatically assigned processing node {} to {}".format(self.processing_node, self))
|
||||||
self.status = None
|
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
# Processing node assigned, but is offline and no errors
|
# Processing node assigned, but is offline and no errors
|
||||||
|
@ -313,7 +312,9 @@ class Task(models.Model):
|
||||||
logger.info("Processing node {} went offline, reassigning {}...".format(self.processing_node, self))
|
logger.info("Processing node {} went offline, reassigning {}...".format(self.processing_node, self))
|
||||||
self.uuid = ''
|
self.uuid = ''
|
||||||
self.processing_node = None
|
self.processing_node = None
|
||||||
|
self.status = None
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
elif self.status == status_codes.RUNNING:
|
elif self.status == status_codes.RUNNING:
|
||||||
# Task was running and processing node went offline
|
# Task was running and processing node went offline
|
||||||
# It could have crashed due to low memory
|
# It could have crashed due to low memory
|
||||||
|
|
|
@ -580,14 +580,15 @@ class TestApiTask(BootTransactionTestCase):
|
||||||
# Processing node is now cleared and a new one will be assigned on the next tick
|
# Processing node is now cleared and a new one will be assigned on the next tick
|
||||||
task.refresh_from_db()
|
task.refresh_from_db()
|
||||||
self.assertTrue(task.processing_node is None)
|
self.assertTrue(task.processing_node is None)
|
||||||
|
self.assertTrue(task.status is None)
|
||||||
|
|
||||||
worker.tasks.process_pending_tasks()
|
worker.tasks.process_pending_tasks()
|
||||||
|
|
||||||
task.refresh_from_db()
|
task.refresh_from_db()
|
||||||
self.assertTrue(task.processing_node.id == another_pnode.id)
|
self.assertTrue(task.processing_node.id == another_pnode.id)
|
||||||
self.assertTrue(task.status == None)
|
|
||||||
|
|
||||||
# Set task to queued, bring node offline
|
# Set task to queued, bring node offline
|
||||||
|
task.last_error = None
|
||||||
task.status = status_codes.RUNNING
|
task.status = status_codes.RUNNING
|
||||||
task.save()
|
task.save()
|
||||||
another_pnode.last_refreshed = timezone.now() - timedelta(minutes=OFFLINE_MINUTES)
|
another_pnode.last_refreshed = timezone.now() - timedelta(minutes=OFFLINE_MINUTES)
|
||||||
|
|
Ładowanie…
Reference in New Issue