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

Side by Side Diff: devil/devil/utils/watchdog_timer.py

Issue 3000973002: Make timeout_retry include the total timeout in the exception error (Closed)
Patch Set: Created 3 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « devil/devil/utils/timeout_retry.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """WatchdogTimer timeout objects.""" 5 """WatchdogTimer timeout objects."""
6 6
7 import time 7 import time
8 8
9 9
10 class WatchdogTimer(object): 10 class WatchdogTimer(object):
(...skipping 19 matching lines...) Expand all
30 """Returns the elapsed time of the watchdog.""" 30 """Returns the elapsed time of the watchdog."""
31 return time.time() - self._start_time 31 return time.time() - self._start_time
32 32
33 def GetRemaining(self): 33 def GetRemaining(self):
34 """Returns the remaining time of the watchdog.""" 34 """Returns the remaining time of the watchdog."""
35 if self._timeout: 35 if self._timeout:
36 return self._timeout - self.GetElapsed() 36 return self._timeout - self.GetElapsed()
37 else: 37 else:
38 return None 38 return None
39 39
40 def GetTimeout(self):
41 """Returns the timout of the watchdog."""
42 return self._timeout
43
40 def IsTimedOut(self): 44 def IsTimedOut(self):
41 """Whether the watchdog has timed out. 45 """Whether the watchdog has timed out.
42 46
43 Returns: 47 Returns:
44 True if the watchdog has timed out, False otherwise. 48 True if the watchdog has timed out, False otherwise.
45 """ 49 """
46 remaining = self.GetRemaining() 50 remaining = self.GetRemaining()
47 return remaining is not None and remaining < 0 51 return remaining is not None and remaining < 0
OLDNEW
« no previous file with comments | « devil/devil/utils/timeout_retry.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698