try:
task.execute()
except:
+ # Let the failed() callback function arrange for the
+ # build to stop if that's appropriate.
self.taskmaster.failed(task)
- return
else:
self.taskmaster.executed(task)
finally:
cv.acquire()
except:
+ # Let the failed() callback function arrange for
+ # calling self.jobs.stop() to to stop the build
+ # if that's appropriate.
self.taskmaster.failed(task)
- # stop all jobs since there was a failure:
- # (this will wake up any waiting jobs, so
- # it isn't necessary to explicitly wake them
- # here)
- self.jobs.stop()
else:
self.taskmaster.executed(task)
"""n is the number of dummy tasks to perform."""
self.test_case = test_case
+ self.stop = None
self.num_tasks = n
self.num_iterated = 0
self.num_executed = 0
def next_task(self):
- if self.all_tasks_are_iterated():
+ if self.stop or self.all_tasks_are_iterated():
return None
else:
self.num_iterated = self.num_iterated + 1
def failed(self, task):
self.num_failed = self.num_failed + 1
+ self.stop = 1
def is_blocked(self):
# simulate blocking tasks