X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fframework.py;h=4f830ba613e3386db662be3996b9bd5d705b8589;hb=3d9b92a0c56c3cbe51e75bc3cb40d3d2db2d3720;hp=3201e632348377dae2c4da2e63b495b7f1306889;hpb=dfb5f2aff3675b3d70ba024dfd367c688ea1def6;p=vpp.git diff --git a/test/framework.py b/test/framework.py index 3201e632348..4f830ba613e 100644 --- a/test/framework.py +++ b/test/framework.py @@ -151,6 +151,7 @@ class KeepAliveReporter(object): def __init__(self): self.__dict__ = self._shared_state + self._pipe = None @property def pipe(self): @@ -158,7 +159,7 @@ class KeepAliveReporter(object): @pipe.setter def pipe(self, pipe): - if hasattr(self, '_pipe'): + if self._pipe is not None: raise Exception("Internal error - pipe should only be set once.") self._pipe = pipe @@ -356,9 +357,15 @@ class VppTestCase(unittest.TestCase): @classmethod def wait_for_stats_socket(cls): deadline = time.time() + 3 - while time.time() < deadline or cls.debug_gdb or cls.debug_gdbserver: + ok = False + while time.time() < deadline or \ + cls.debug_gdb or cls.debug_gdbserver: if os.path.exists(cls.stats_sock): + ok = True break + time.sleep(0.8) + if not ok: + cls.logger.critical("Couldn't stat : {}".format(cls.stats_sock)) @classmethod def setUpClass(cls): @@ -372,6 +379,7 @@ class VppTestCase(unittest.TestCase): cls.logger = get_logger(cls.__name__) if hasattr(cls, 'parallel_handler'): cls.logger.addHandler(cls.parallel_handler) + cls.logger.propagate = False cls.tempdir = tempfile.mkdtemp( prefix='vpp-unittest-%s-' % cls.__name__) cls.stats_sock = "%s/stats.sock" % cls.tempdir