summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-21 15:53:50 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-22 11:26:56 -0500
commit1443c542870de8c7186c361306078010f406fa83 (patch)
treeb09b8f06c3e5aebc73d30dab996c42626a96400b
parent76148785eb8d59638a2fbdae8ae145aba50d6c51 (diff)
downloadbuildstream-tristan/fix-terminated-status.tar.gz
_scheduler: Fix dont display a failure for terminated jobstristan/fix-terminated-status
This fixes a recent regression introduced in c2fc2a5ea
-rw-r--r--buildstream/_scheduler/jobs/job.py10
-rw-r--r--buildstream/_scheduler/queues/queue.py2
2 files changed, 11 insertions, 1 deletions
diff --git a/buildstream/_scheduler/jobs/job.py b/buildstream/_scheduler/jobs/job.py
index 91ed187b0..7f14cf05f 100644
--- a/buildstream/_scheduler/jobs/job.py
+++ b/buildstream/_scheduler/jobs/job.py
@@ -184,6 +184,16 @@ class Job():
self._terminated = True
+ # get_terminated()
+ #
+ # Check if a job has been terminated.
+ #
+ # Returns:
+ # (bool): True in the main process if Job.terminate() was called.
+ #
+ def get_terminated(self):
+ return self._terminated
+
# terminate_wait()
#
# Wait for terminated jobs to complete
diff --git a/buildstream/_scheduler/queues/queue.py b/buildstream/_scheduler/queues/queue.py
index a20f44eea..9f0563fa5 100644
--- a/buildstream/_scheduler/queues/queue.py
+++ b/buildstream/_scheduler/queues/queue.py
@@ -305,7 +305,7 @@ class Queue():
self._done_queue.append(element)
# These lists are for bookkeeping purposes for the UI and logging.
- if status == JobStatus.SKIPPED:
+ if status == JobStatus.SKIPPED or job.get_terminated():
self.skipped_elements.append(element)
elif status == JobStatus.OK:
self.processed_elements.append(element)