From: Joao Eduardo Luis Date: Fri, 25 Jan 2013 12:09:49 +0000 (+0000) Subject: task: mon_clock_skew_check: increase timeout and kick it off only on stop X-Git-Tag: 1.1.0~2359 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aa85d914c43dacedda03373df4a9d0f78760a168;p=teuthology.git task: mon_clock_skew_check: increase timeout and kick it off only on stop We were kicking-off the timeout as soon as we started; it's better however to kick if off only when we are told to stop (as long as 'at-least-once' is true). Signed-off-by: Joao Eduardo Luis --- diff --git a/teuthology/task/mon_clock_skew_check.py b/teuthology/task/mon_clock_skew_check.py index 41596e28b0..e45c6528e5 100644 --- a/teuthology/task/mon_clock_skew_check.py +++ b/teuthology/task/mon_clock_skew_check.py @@ -35,7 +35,7 @@ class ClockSkewCheck: (default: True) at-least-once-timeout If we were told to stop but we are attempting to run at least once, timeout after this many seconds. - (default: 300) + (default: 600) Example: Expect a skew higher than 0.05 seconds, but only report it without failing @@ -64,7 +64,7 @@ class ClockSkewCheck: self.expect_skew = self.config.get('expect-skew', False) self.never_fail = self.config.get('never-fail', False) self.at_least_once = self.config.get('at-least-once', True) - self.at_least_once_timeout = self.config.get('at-least-once-timeout', 300.0) + self.at_least_once_timeout = self.config.get('at-least-once-timeout', 600.0) def info(self, x): self.logger.info(x) @@ -88,12 +88,15 @@ class ClockSkewCheck: self.info('start checking for clock skews') skews = dict() ran_once = False - started_on = time.time() + started_on = None while not self.stopping or (self.at_least_once and not ran_once): if self.at_least_once and not ran_once and self.stopping: - if self.at_least_once_timeout > 0.0: + if started_on is None: + self.info('kicking-off timeout (if any)') + started_on = time.time() + elif self.at_least_once_timeout > 0.0: assert time.time() - started_on < self.at_least_once_timeout, \ 'failed to obtain a timecheck before timeout expired'