Commit e0be6886 authored by André Anjos's avatar André Anjos 💬

[backend,experiments] Test fixes; More tests

parent 190ea5e3
Pipeline #1558 failed with stage
......@@ -647,7 +647,7 @@ class Job(models.Model):
for b in self.block.dependents.all():
if any([k.status in (Block.FAILED, Block.CANCELLED) \
for k in b.dependencies.all()]):
for split in b.job.splits: split.end(None, Job.CANCELLED)
if all([k.status in (Block.CACHED, Block.SKIPPED) \
for k in b.dependencies.all()]):
......@@ -708,7 +708,7 @@ class Job(models.Model):
# if required, erase dangling files, update own results
timings = None
if self.done():
if self.done() and self.status != Job.CANCELLED:
# compute final timings and update parent block
if self.status != Job.SKIPPED:
diff_timings = self._merge_results()
......@@ -740,7 +740,7 @@ class Job(models.Model):
failed = self.status in (Job.FAILED, Job.CANCELLED)
if failed:
for o in self.block.outputs: l += o.files()
for o in self.block.outputs.all(): l += o.files()
for f in l:"Erasing output file `%s' because Job `%s' failed", f,
......@@ -764,8 +764,13 @@ class Job(models.Model):"Marking job `%s' as 'cancelled'", self)
self.runnable_date = None
self.start_date = None
for s in self.splits: s._cancel()
if self.splits.count():
for s in self.splits.all(): s._cancel()
self.status = Job.CANCELLED
def _merge_results(self):
......@@ -960,7 +965,7 @@ class JobSplit(models.Model):
if is None:
self.result = result
self.status = state
self.status = status
This diff is collapsed.
......@@ -998,7 +998,8 @@ class Block(models.Model):
if self.done(): return
if hasattr(self, 'job'): self.job._cancel()
if hasattr(self, 'job'):
self.status = Block.CANCELLED
......@@ -1060,7 +1061,9 @@ class Block(models.Model):
if self.job.done():
self.end_date = self.job.end_date
self.job.result.delete() #cascades to job/job split deletion
r = self.job.result
if r: r.delete()
# Loads Results from cache
if self.job.result and self.analyzer and self.status == Block.CACHED:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment