mirror of
https://github.com/status-im/cabot.git
synced 2025-02-24 10:28:06 +00:00
Test for timing
This commit is contained in:
parent
6c9e70ef34
commit
befb85b3e0
@ -798,7 +798,7 @@ class StatusCheckResult(models.Model):
|
||||
Time taken by check in ms
|
||||
"""
|
||||
try:
|
||||
diff = (self.time_complete - self.time).microseconds
|
||||
diff = self.time_complete - self.time
|
||||
return (diff.microseconds + (diff.seconds + diff.days * 24 * 3600) * 10**6) / 1000
|
||||
except:
|
||||
return None
|
||||
|
@ -258,6 +258,8 @@ class TestCheckRun(LocalTestCase):
|
||||
self.assertFalse(self.graphite_check.last_result().succeeded)
|
||||
self.assertEqual(self.graphite_check.calculated_status,
|
||||
Service.CALCULATED_FAILING_STATUS)
|
||||
# Test results timing
|
||||
self.assertGreater(list(checkresults)[-1].took, 0.0)
|
||||
|
||||
@patch('cabot.cabotapp.jenkins.requests.get', fake_jenkins_response)
|
||||
def test_jenkins_run(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user