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

[backend] Simulate job killing by worker on tests

parent 936933f0
No related branches found
No related tags found
1 merge request!194Scheduler
......@@ -1179,6 +1179,11 @@ class Scheduling(BaseBackendTestCase):
xp.cancel()
# simulate worker cancelling
split.refresh_from_db()
self.assertEqual(split.status, Job.KILL)
split.end(None, Job.CANCELLED)
self.assertEqual(
[str(k) for k in xp.blocks.order_by('id').values_list('status', flat=True)],
[Block.CANCELLED, Block.CANCELLED]
......@@ -1630,6 +1635,12 @@ class Scheduling(BaseBackendTestCase):
# cancels the blocking experiment - the blocked one must continue
xp.cancel()
# simulate worker cancelling
split.refresh_from_db()
self.assertEqual(split.status, Job.KILL)
split.end(None, Job.CANCELLED)
self.assertEqual(
[str(k) for k in xp.blocks.order_by('id').values_list('status', flat=True)],
[Block.CANCELLED, Block.CANCELLED]
......
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