Merge "builds: set missing start/end time for node errors"

This commit is contained in:
Zuul 2018-12-20 00:44:01 +00:00 committed by Gerrit Code Review
commit ea3e777469
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@
import datetime
import logging
import time
import voluptuous as v
from zuul.reporter import BaseReporter
@ -55,6 +56,9 @@ class SQLReporter(BaseReporter):
# stats about builds. It doesn't understand how to store
# information about the change.
continue
# Ensure end_time is defined
if not build.end_time:
build.end_time = time.time()
(result, url) = item.formatJobResult(job)
start = end = None

View File

@ -2258,6 +2258,8 @@ class QueueItem(object):
def setNodeRequestFailure(self, job):
fakebuild = Build(job, None)
fakebuild.start_time = time.time()
fakebuild.end_time = time.time()
self.addBuild(fakebuild)
fakebuild.result = 'NODE_FAILURE'
self.setResult(fakebuild)