Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: scheduler/scheduler_models.py

Issue 4758002: Fix problem with new upstream lmr code for email. (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scheduler/scheduler_models.py
diff --git a/scheduler/scheduler_models.py b/scheduler/scheduler_models.py
index 0a6ae7b3a6b5274e7a1937ceddb3a389dbc15c98..870914d5de0b2a3d3aa76d211b15058762ac059d 100644
--- a/scheduler/scheduler_models.py
+++ b/scheduler/scheduler_models.py
@@ -892,6 +892,7 @@ class Job(DBObject):
WHERE t.job_idx = j.job_idx
AND s.status_idx = t.status
AND j.afe_job_id = %s
+ ORDER BY t.reason
""" % self.id)
failed_rows = [r for r in rows if not 'GOOD' in r]
@@ -927,11 +928,15 @@ class Job(DBObject):
if time_row:
t_begin, t_end = time_row[0]
- delta = t_end - t_begin
- minutes, seconds = divmod(delta.seconds, 60)
- hours, minutes = divmod(minutes, 60)
- stats['execution_time'] = ("%02d:%02d:%02d" %
- (hours, minutes, seconds))
+ try:
+ delta = t_end - t_begin
+ minutes, seconds = divmod(delta.seconds, 60)
+ hours, minutes = divmod(minutes, 60)
+ stats['execution_time'] = ("%02d:%02d:%02d" %
+ (hours, minutes, seconds))
+ # One of t_end or t_begin are None
+ except TypeError:
+ stats['execution_time'] = '(could not determine)'
else:
stats['execution_time'] = '(none)'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698