def get_waiting(self) -> List[str]: tasks = self.onefuzz.tasks.list(job_id=self.job.job_id) waiting = [ "%s:%s" % (x.config.task.type.name, x.state.name) for x in tasks if x.state not in TaskState.has_started() ] return waiting
def mark_stopping(self) -> None: if self.state in TaskState.shutting_down(): logging.debug("ignoring post-task stop calls to stop %s:%s", self.job_id, self.task_id) return if self.state not in TaskState.has_started(): self.mark_failed( Error(code=ErrorCode.TASK_FAILED, errors=["task never started"])) self.set_state(TaskState.stopping)
def get_waiting(self) -> List[str]: tasks = self.get_running_tasks_checked() waiting = [] for task in tasks: state_msg = task.state.name if task.state in TaskState.has_started(): task = self.onefuzz.tasks.get(task.task_id) if task.events: continue state_msg = "waiting-for-heartbeat" waiting.append(f"{task.config.task.type.name}:{state_msg}") return waiting