Skip to content

Commit

Permalink
fix time typecasting (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
thealphadollar authored and canihavesomecoffee committed Aug 21, 2019
1 parent dcc015d commit 308fb09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mod_ci/controllers.py
Expand Up @@ -831,7 +831,8 @@ def progress_type_request(log, test, test_id, request):
kvm_entry.timestamp_prep_finished = prep_finish_time
g.db.commit()
# set time taken in seconds to do preparation
time_diff = (prep_finish_time - kvm_entry.timestamp).total_seconds()
time_diff = (prep_finish_time - datetime.strptime(kvm_entry.timestamp,
'%Y-%m-%d %H:%M:%S')).total_seconds()
set_avg_time(test.platform, "prep", time_diff)

elif status == TestStatus.testing:
Expand All @@ -840,7 +841,8 @@ def progress_type_request(log, test, test_id, request):
kvm_entry.timestamp_build_finished = build_finish_time
g.db.commit()
# set time taken in seconds to do preparation
time_diff = (build_finish_time - kvm_entry.timestamp_prep_finished).total_seconds()
time_diff = (build_finish_time - datetime.strptime(kvm_entry.timestamp_prep_finished,
'%Y-%m-%d %H:%M:%S')).total_seconds()
set_avg_time(test.platform, "build", time_diff)

progress = TestProgress(test.id, status, message)
Expand Down

0 comments on commit 308fb09

Please sign in to comment.