Skip to content
Snippets Groups Projects
Commit 932d515d authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[backend] Test for checking concurrent execution

parent 005b4a25
No related branches found
No related tags found
1 merge request!194Scheduler
Pipeline #
...@@ -1843,6 +1843,30 @@ class Scheduling(BaseBackendTestCase): ...@@ -1843,6 +1843,30 @@ class Scheduling(BaseBackendTestCase):
self.assertEqual(worker.available_cores(), qsetup.CORES) self.assertEqual(worker.available_cores(), qsetup.CORES)
def test_schedules_two_jobs(self):
# tests a simple scheduling activity in which two jobs of the same
# experiment must be scheduled concurrently, provided there is enough
# space
current_stats = HourlyStatistics.objects.count()
fullname = 'user/user/triangle/1/triangle'
xp = Experiment.objects.get(name=fullname.split(os.sep)[-1])
worker = Worker.objects.get()
# schedules the experiment and check it
xp.schedule()
xp.refresh_from_db()
self.assertEqual(xp.status, Experiment.SCHEDULED)
assigned_splits = schedule()
self.assertEqual(len(assigned_splits), 2)
self.assertEqual(assigned_splits[0].job.block.experiment, xp)
self.assertEqual(assigned_splits[1].job.block.experiment, xp)
self.assertNotEqual(assigned_splits[0], assigned_splits[1])
class SchedulingPriority(BaseBackendTestCase): class SchedulingPriority(BaseBackendTestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment