Commit f2a0d7d2 authored by Julien Muchembled's avatar Julien Muchembled

taskdistribution: fix wrong calculation of watcher sleeps

There was a sign error in the formula and it lacks code to deal with clock
changes.
Because the watcher will be removed, this patch reverts to imprecise but safe
and simple implementation.
parent 0587079a
...@@ -317,7 +317,6 @@ class TestResultProxy(RPCRetry): ...@@ -317,7 +317,6 @@ class TestResultProxy(RPCRetry):
def _watcher(self): def _watcher(self):
cond = self._watcher_condition cond = self._watcher_condition
while self._watcher_can_run and self.isAlive(): while self._watcher_can_run and self.isAlive():
working = time.time()
caption_list = [] caption_list = []
append = caption_list.append append = caption_list.append
for name, (stream, max_history_bytes) in \ for name, (stream, max_history_bytes) in \
...@@ -341,8 +340,7 @@ class TestResultProxy(RPCRetry): ...@@ -341,8 +340,7 @@ class TestResultProxy(RPCRetry):
append(caption) append(caption)
self.reportStatus('', '\n'.join(caption_list), '') self.reportStatus('', '\n'.join(caption_list), '')
with cond: with cond:
cond.wait(max(self._watcher_period - (working - time.time()), cond.wait(self._watcher_period)
0))
def _stopWatching(self): def _stopWatching(self):
cond = self._watcher_condition cond = self._watcher_condition
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment