only record failures generated prior to stopping (#83)

This commit is contained in:
bmc-msft
2020-10-02 01:31:51 -04:00
committed by GitHub
parent a529f073a8
commit a196716e12
4 changed files with 29 additions and 16 deletions

View File

@ -24,7 +24,7 @@ from azure.devops.v6_0.work_item_tracking.work_item_tracking_client import (
WorkItemTrackingClient,
)
from memoization import cached
from onefuzztypes.enums import ErrorCode, TaskState
from onefuzztypes.enums import ErrorCode
from onefuzztypes.models import ADOTemplate, Error, Report
from ..tasks.main import Task
@ -211,9 +211,9 @@ def fail_task(report: Report, error: Exception) -> None:
task = Task.get(report.job_id, report.task_id)
if task:
task.error = Error(code=ErrorCode.NOTIFICATION_FAILURE, errors=[str(error)])
task.state = TaskState.stopping
task.save()
task.mark_failed(
Error(code=ErrorCode.NOTIFICATION_FAILURE, errors=[str(error)])
)
def notify_ado(