aboutsummaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-04-19 07:10:58 +0000
committerDamjan Marion <dmarion.lists@gmail.com>2017-04-20 13:29:09 +0000
commit3cfa558a24ca19745b248304bf9dc4c69bda342a (patch)
treed0b1144848886aaaa61dd5733a8d3a3d4b4d2fd9 /test/framework.py
parent48009e4c5732180ecc951ac6359b9b96d38b8dc2 (diff)
make test: improve bfd reliability
Change-Id: Iaf446a2d7d8e595c3379fb9ed61a954351c17b90 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/framework.py b/test/framework.py
index f105950ad5a..91915fca447 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -648,8 +648,18 @@ class VppTestCase(unittest.TestCase):
@classmethod
def sleep(cls, timeout, remark=None):
if hasattr(cls, 'logger'):
- cls.logger.debug("Sleeping for %ss (%s)" % (timeout, remark))
+ cls.logger.debug("Starting sleep for %ss (%s)" % (timeout, remark))
+ before = time.time()
time.sleep(timeout)
+ after = time.time()
+ if after - before > 2 * timeout:
+ cls.logger.error(
+ "time.sleep() derp! slept for %ss instead of ~%ss!" % (
+ after - before, timeout))
+ if hasattr(cls, 'logger'):
+ cls.logger.debug(
+ "Finished sleep (%s) - slept %ss (wanted %ss)" % (
+ remark, after - before, timeout))
class TestCasePrinter(object):