From: Joao Eduardo Luis Date: Wed, 30 Jan 2013 20:52:03 +0000 (+0000) Subject: task: mon_clock_skew_check: mark as ran once if an expected skew was found X-Git-Tag: 1.1.0~2351 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=89e09fa90cdb5e3bf941bb74dc1ac42d9f5512c7;p=teuthology.git task: mon_clock_skew_check: mark as ran once if an expected skew was found ... even if we didn't get a clean/finished result from the monitors This ought to significantly cut the waiting time if something else (or someone else) is leaving the leader hanging thus unable to finish a given timecheck round. 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 e45c6528e5..c48efd9c4d 100644 --- a/teuthology/task/mon_clock_skew_check.py +++ b/teuthology/task/mon_clock_skew_check.py @@ -84,6 +84,16 @@ class ClockSkewCheck: s=self.check_interval)) time.sleep(self.check_interval) + def print_skews(self, skews): + total = len(skews) + if total > 0: + self.info('---------- found {n} skews ----------'.format(n=total)) + for mon_id,values in skews.iteritems(): + self.info('mon.{id}: {v}'.format(id=mon_id,v=values)) + self.info('-------------------------------------') + else: + self.info('---------- no skews were found ----------') + def do_check(self): self.info('start checking for clock skews') skews = dict() @@ -151,18 +161,13 @@ class ClockSkewCheck: else: self.warn('unexpected skew: {str}'.format(str=log_str)) - if clean_check: + if clean_check or (self.expect_skew and len(skews) > 0): ran_once = True + self.print_skews(skews) self.sleep_interval() total = len(skews) - if total > 0: - self.info('---------- found {n} skews ----------'.format(n=total)) - for mon_id,values in skews.iteritems(): - self.info('mon.{id}: {v}'.format(id=mon_id,v=values)) - self.info('-------------------------------------') - else: - self.info('---------- no skews were found ----------') + self.print_skews(skews) error_str = '' found_error = False