]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task: mon_clock_skew_check: increase timeout and kick it off only on stop
authorJoao Eduardo Luis <jecluis@gmail.com>
Fri, 25 Jan 2013 12:09:49 +0000 (12:09 +0000)
committerSage Weil <sage@inktank.com>
Sat, 26 Jan 2013 01:56:09 +0000 (17:56 -0800)
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 <jecluis@gmail.com>
teuthology/task/mon_clock_skew_check.py

index 41596e28b07090960d649468850731ca922a9601..e45c6528e5638f6c4d39d6bec1a382ed17518f97 100644 (file)
@@ -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'