summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-12-20 00:44:01 +0000
committerGerrit Code Review <review@openstack.org>2018-12-20 00:44:01 +0000
commitea3e777469a67fb3c55041df22f46f79a4f91f7c (patch)
treee46d1950c5abb47eec9464d115d47e4ee97b7f24
parent4389e9faa1da2fb7ee748ee7171ad1b566b00399 (diff)
parent3727ef7b9cb7f883656f36531bf8e94fcc198664 (diff)
Merge "builds: set missing start/end time for node errors"
-rw-r--r--zuul/driver/sql/sqlreporter.py4
-rw-r--r--zuul/model.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/zuul/driver/sql/sqlreporter.py b/zuul/driver/sql/sqlreporter.py
index 4b80923..327bbb9 100644
--- a/zuul/driver/sql/sqlreporter.py
+++ b/zuul/driver/sql/sqlreporter.py
@@ -14,6 +14,7 @@
14 14
15import datetime 15import datetime
16import logging 16import logging
17import time
17import voluptuous as v 18import voluptuous as v
18 19
19from zuul.reporter import BaseReporter 20from zuul.reporter import BaseReporter
@@ -55,6 +56,9 @@ class SQLReporter(BaseReporter):
55 # stats about builds. It doesn't understand how to store 56 # stats about builds. It doesn't understand how to store
56 # information about the change. 57 # information about the change.
57 continue 58 continue
59 # Ensure end_time is defined
60 if not build.end_time:
61 build.end_time = time.time()
58 62
59 (result, url) = item.formatJobResult(job) 63 (result, url) = item.formatJobResult(job)
60 start = end = None 64 start = end = None
diff --git a/zuul/model.py b/zuul/model.py
index 70f392c..d6b1c6a 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -2258,6 +2258,8 @@ class QueueItem(object):
2258 2258
2259 def setNodeRequestFailure(self, job): 2259 def setNodeRequestFailure(self, job):
2260 fakebuild = Build(job, None) 2260 fakebuild = Build(job, None)
2261 fakebuild.start_time = time.time()
2262 fakebuild.end_time = time.time()
2261 self.addBuild(fakebuild) 2263 self.addBuild(fakebuild)
2262 fakebuild.result = 'NODE_FAILURE' 2264 fakebuild.result = 'NODE_FAILURE'
2263 self.setResult(fakebuild) 2265 self.setResult(fakebuild)