PIM testing: fix reference to start time in testActive
Binding _done() to self.start reads the *current* value of self.start when _done() gets called. We need to bind to an inmuted local instance instead to achieve the desired effect.
This commit is contained in:
parent
e583973999
commit
48b577370f
1 changed files with 4 additions and 3 deletions
|
@ -253,10 +253,11 @@ class Watchdog():
|
|||
if not self.started:
|
||||
# Run with a long timeout. We want to know how long it
|
||||
# takes to reply, even if it is too long.
|
||||
self.started = time.time()
|
||||
started = time.time()
|
||||
self.started = started
|
||||
self.manager.GetAllPeers(timeout=1000,
|
||||
reply_handler=lambda peers: self._done(self.started, self.results, None),
|
||||
error_handler=lambda error: self._done(self.started, self.results, error))
|
||||
reply_handler=lambda peers: self._done(started, self.results, None),
|
||||
error_handler=lambda error: self._done(started, self.results, error))
|
||||
return True
|
||||
|
||||
def _done(self, started, results, error):
|
||||
|
|
Loading…
Reference in a new issue