builds: set missing start/end time for node errors
When a build failed with NODE_FAILURE, the reported result doesn't have a start/end time. Change-Id: I3323347e6c91932690dac998c68eaf4a0fea2e5f
This commit is contained in:
parent
be64ed2777
commit
3727ef7b9c
|
@ -14,6 +14,7 @@
|
|||
|
||||
import datetime
|
||||
import logging
|
||||
import time
|
||||
import voluptuous as v
|
||||
|
||||
from zuul.reporter import BaseReporter
|
||||
|
@ -65,6 +66,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)
|
||||
|
||||
|
|
|
@ -2219,6 +2219,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)
|
||||
|
|
Loading…
Reference in New Issue