From: Paul Vinciguerra Date: Thu, 15 Nov 2018 16:13:03 +0000 (-0800) Subject: VPP-1495: Fix intermittent stat sock test failures. X-Git-Tag: v19.04-rc0~391 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=dd4b2bb39491cb8fbfb5db8a4b9ffc3b80beba48 VPP-1495: Fix intermittent stat sock test failures. Loosen polling loop while waiting for stats socket. ============================================================================== Classifier IP6 UDP proto Test Case ============================================================================== connect: No such file or directory ============================================================================== ERROR: setUpClass (test_ip4.TestIPLoadBalance) ------------------------------------------------------------------------------ Traceback (most recent call last): File "/vpp/test/framework.py", line 424, in setUpClass cls.statistics = VPPStats(socketname=cls.stats_sock) File "build/bdist.linux-x86_64/egg/vpp_papi/vpp_stats.py", line 120, in _init_ raise IOError() IOError Change-Id: I80523122f96eafc41b3ebbf27bee73f6c637d781 Signed-off-by: Paul Vinciguerra --- diff --git a/test/framework.py b/test/framework.py index 3201e632348..06876a1799b 100644 --- a/test/framework.py +++ b/test/framework.py @@ -356,9 +356,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):